- Drop the unused polls.show_results_to_participants column (idempotent migration). - Remove CaptchaInterface::getType(), the unused AjaxView with its layout, the empty cell template folder and a redundant setNew() call. - PollsTable::newPoll() normalises and validates once; the create form used to validate the raw input first, so an e-mail address with surrounding spaces was rejected although it would have been trimmed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
38 lines
1001 B
PHP
38 lines
1001 B
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
use Migrations\BaseMigration;
|
|
|
|
/**
|
|
* polls.show_results_to_participants is unused: results belong on the stage, participants
|
|
* only get them where they interact with them (see PollStateService). There is no switch per poll.
|
|
*/
|
|
class DropShowResultsToParticipants extends BaseMigration
|
|
{
|
|
/**
|
|
* @return void
|
|
*/
|
|
public function up(): void
|
|
{
|
|
$table = $this->table('polls');
|
|
if ($table->hasColumn('show_results_to_participants')) {
|
|
$table->removeColumn('show_results_to_participants')->update();
|
|
}
|
|
}
|
|
|
|
/**
|
|
* @return void
|
|
*/
|
|
public function down(): void
|
|
{
|
|
$table = $this->table('polls');
|
|
if (!$table->hasColumn('show_results_to_participants')) {
|
|
$table->addColumn('show_results_to_participants', 'boolean', [
|
|
'null' => false,
|
|
'default' => true,
|
|
'after' => 'is_active',
|
|
])->update();
|
|
}
|
|
}
|
|
}
|