Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/Migration/Version010200Date20200323141300.php
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ public function postSchemaChange(IOutput $output, \Closure $schemaClosure, array
//In case the old Question would have been longer than current possible length, create a warning and shorten text to avoid Error on upgrade.
if (strlen($question['form_question_text']) > 2048) {
$output->warning("Question-text is too long for new Database: '" . $question['form_question_text'] . "'");
$question['form_question_text'] = substr($question['form_question_text'], 0, 2048);
$question['form_question_text'] = mb_substr($question['form_question_text'], 0, 2048);
}

$qb_restore->insert('forms_v2_questions')
Expand All @@ -285,7 +285,7 @@ public function postSchemaChange(IOutput $output, \Closure $schemaClosure, array
//In case the old Answer would have been longer than current possible length, create a warning and shorten text to avoid Error on upgrade.
if (strlen($answer['text']) > 1024) {
$output->warning("Option-text is too long for new Database: '" . $answer['text'] . "'");
$answer['text'] = substr($answer['text'], 0, 1024);
$answer['text'] = mb_substr($answer['text'], 0, 1024);
}

$qb_restore->insert('forms_v2_options')
Expand Down Expand Up @@ -352,7 +352,7 @@ public function postSchemaChange(IOutput $output, \Closure $schemaClosure, array
//In case the old Answer would have been longer than current possible length, create a warning and shorten text to avoid Error on upgrade.
if (strlen($vote['vote_answer']) > 2048) {
$output->warning("Answer-text is too long for new Database: '" . $vote['vote_answer'] . "'");
$vote['vote_answer'] = substr($vote['vote_answer'], 0, 2048);
$vote['vote_answer'] = mb_substr($vote['vote_answer'], 0, 2048);
}

/* Due to the unconventional storing fo vote_option_ids, the vote_option_id needs to get mapped onto old question-id and from there to new question-id.
Expand Down