Skip to content

Commit

Permalink
Merge pull request #917 from warren5236/make-track-selection-optional…
Browse files Browse the repository at this point in the history
…-when-tracks-are-available

Make the track selection option on the talk form.
  • Loading branch information
iansltx committed Apr 24, 2024
2 parents d0c00c0 + 797a87c commit d64200b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions app/src/Talk/TalkController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion app/src/Talk/TalkFormType.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)
'track',
'choice',
[
'required' => (bool) !empty($this->tracks),
'required' => false,
'choices' => ['' => ''] + $this->tracks
]
)
Expand Down

0 comments on commit d64200b

Please sign in to comment.