Remove the "voting open" checkbox from the slide form
CI / Deploy / PHP 8.5 (push) Successful in 1m16s
CI / Deploy / PHP 8.4 (push) Successful in 1m19s
CI / Deploy / test (push) Successful in 1s
CI / Deploy / deploy (push) Skipped

is_voting_open is presenter state (SlideControlService), so the form
never takes it over anymore, for all slide types instead of only quiz
and Q&A. New slides start open (quiz closed), as before.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
gnilebeinandClaude Sonnet 5.5 committed 2026-11-17 14:21:29 +01:00
1 parent 83c76d72ec
commit bb2d1443cf
4 files changed
+9 -16

No files matched your search

+2 -5
View File
@@ -299,11 +299,8 @@ class SlidesController extends AdminAppController
$data['type'] = $slide->type;
// The upload is handled by prepareImage(); the marshaller must not see the file object.
unset($data['image']);
$fields = ['type', 'question', 'description', 'settings', 'is_voting_open'];
if ($slide->isQuiz() || $slide->isQa()) {
// Quiz and Q&A voting is controlled by the presenter only.
$fields = array_values(array_diff($fields, ['is_voting_open']));
}
// is_voting_open is presenter state (SlideControlService), never editable via the form.
$fields = ['type', 'question', 'description', 'settings'];
$youtube = $slide->isYouTube() ? $this->prepareYouTube($data) : ['errors' => [], 'warning' => null];
$this->Slides->patchEntity($slide, $data, ['fields' => $fields, 'associated' => []]);
foreach ($youtube['errors'] as $field => $message) {