diff --git a/app/src/Talk/TalkController.php b/app/src/Talk/TalkController.php index 7addd14b..51ec4757 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) { diff --git a/app/src/Talk/TalkFormType.php b/app/src/Talk/TalkFormType.php index 37312bc3..05524b9c 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 ] )