Skip to content

Commit 996238f

Browse files
committed
complete backport
Signed-off-by: dartcafe <github@dartcafe.de>
1 parent 90ff298 commit 996238f

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

lib/Db/TableManager.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -380,11 +380,16 @@ public function migrateOptionsToHash(): array {
380380
$count = 0;
381381
if ($table->hasColumn('poll_option_hash')) {
382382
foreach ($this->optionMapper->getAll() as $option) {
383-
$option->syncOption();
384-
// $option->setPollOptionHash(hash('md5', $option->getPollId() . $option->getPollOptionText() . $option->getTimestamp()));
383+
try {
384+
$option->syncOption();
385+
// $option->setPollOptionHash(hash('md5', $option->getPollId() . $option->getPollOptionText() . $option->getTimestamp()));
385386

386-
$this->optionMapper->update($option);
387-
$count++;
387+
$this->optionMapper->update($option);
388+
$count++;
389+
} catch (Exception $e) {
390+
$messages[] = 'Skip hash update - Error updating option hash for optionId ' . $option->getId();
391+
$this->logger->error('Error updating option hash for optionId {id}', ['id' => $option->getId(), 'message' => $e->getMessage()]);
392+
}
388393
}
389394

390395
$this->logger->info('Updated {number} hashes in {db}', ['number' => $count,'db' => $this->dbPrefix . OptionMapper::TABLE]);

0 commit comments

Comments
 (0)