From fd1c65ffc741d55b16a64661226ed21f40c71e52 Mon Sep 17 00:00:00 2001 From: Sebastian Marcet Date: Thu, 14 Dec 2017 11:45:04 -0300 Subject: [PATCH] Fix on post event added boolean validation Change-Id: I1d0fdfccee32d61db6cdabb00141ec6dba23fd0c --- .../Summit/Events/Presentations/Presentation.php | 7 ++++--- app/Services/Model/SummitService.php | 15 ++++++++++----- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/app/Models/Foundation/Summit/Events/Presentations/Presentation.php b/app/Models/Foundation/Summit/Events/Presentations/Presentation.php index a03074e4..5a6e5838 100644 --- a/app/Models/Foundation/Summit/Events/Presentations/Presentation.php +++ b/app/Models/Foundation/Summit/Events/Presentations/Presentation.php @@ -162,9 +162,10 @@ class Presentation extends SummitEvent public function __construct() { parent::__construct(); - $this->materials = new ArrayCollection(); - $this->speakers = new ArrayCollection(); - $this->to_record = false; + $this->materials = new ArrayCollection(); + $this->speakers = new ArrayCollection(); + $this->to_record = false; + $this->feature_cloud = false; } /** diff --git a/app/Services/Model/SummitService.php b/app/Services/Model/SummitService.php index 1bb87054..d28a5bb1 100644 --- a/app/Services/Model/SummitService.php +++ b/app/Services/Model/SummitService.php @@ -620,8 +620,8 @@ final class SummitService implements ISummitService if (isset($data['title'])) $event->setTitle(html_entity_decode(trim($data['title']))); - if (isset($data['abstract'])) - $event->setAbstract(html_entity_decode(trim($data['abstract']))); + if (isset($data['description'])) + $event->setAbstract(html_entity_decode(trim($data['description']))); if (isset($data['rsvp_link'])) $event->setRsvpLink(html_entity_decode(trim($data['rsvp_link']))); @@ -632,8 +632,9 @@ final class SummitService implements ISummitService if (isset($data['social_summary'])) $event->setSocialSummary(strip_tags(trim($data['social_summary']))); - if (isset($data['allow_feedback'])) - $event->setAllowFeedBack($data['allow_feedback']); + $event->setAllowFeedBack(isset($data['allow_feedback'])? + filter_var($data['allow_feedback'], FILTER_VALIDATE_BOOLEAN) : + false); if (!is_null($event_type)) $event->setType($event_type); @@ -725,12 +726,16 @@ final class SummitService implements ISummitService if(isset($data['level'])) $event->setLevel($data['level']); + $event->setFeatureCloud(isset($data['feature_cloud'])? + filter_var($data['feature_cloud'], FILTER_VALIDATE_BOOLEAN) : 0); + // if we are creating the presentation from admin, then // we should mark it as received and complete $event->setStatus(Presentation::STATUS_RECEIVED); $event->setProgress(Presentation::PHASE_COMPLETE); - $event->setToRecord(isset($data['to_record'])? $data['to_record'] : 0); + $event->setToRecord(isset($data['to_record'])? + filter_var($data['to_record'], FILTER_VALIDATE_BOOLEAN): 0); // speakers