From e8512145d06ab75f8d4e811c5611c6b0040f3878 Mon Sep 17 00:00:00 2001 From: Scott Keck-Warren Date: Fri, 6 Oct 2023 13:50:49 +0000 Subject: [PATCH 1/2] Make the track selction option on the talk form. --- app/src/Talk/TalkFormType.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/Talk/TalkFormType.php b/app/src/Talk/TalkFormType.php index 37312bc37..05524b9cd 100644 --- a/app/src/Talk/TalkFormType.php +++ b/app/src/Talk/TalkFormType.php @@ -160,7 +160,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) 'track', 'choice', [ - 'required' => (bool) !empty($this->tracks), + 'required' => false, 'choices' => ['' => ''] + $this->tracks ] ) From 797a87cc34f25baa49a1b0c411a79315ef1e8734 Mon Sep 17 00:00:00 2001 From: Scott Keck-Warren Date: Fri, 6 Oct 2023 14:08:13 +0000 Subject: [PATCH 2/2] Fixed saving of missing track --- app/src/Talk/TalkController.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/src/Talk/TalkController.php b/app/src/Talk/TalkController.php index 7addd14b2..51ec47570 100644 --- a/app/src/Talk/TalkController.php +++ b/app/src/Talk/TalkController.php @@ -200,6 +200,12 @@ public function editTalk($eventSlug, $talkSlug) } } + if (empty($values['track'])) { + foreach ($talk->getTracks() as $t) { + $talkApi->removeTalkFromTrack($t->remove_track_uri); + } + } + $talkUrl = $this->application->urlFor('talk', ['eventSlug' => $eventSlug, 'talkSlug' => $talkSlug]); $this->application->redirect($talkUrl); } catch (\RuntimeException $e) {