Skip to content

Commit

Permalink
MDL-67335 qtype_calculatedmulti: Fix upgrade query.
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyatregubov committed Jan 17, 2024
1 parent 79494ac commit 1fdd34a
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions question/type/calculatedmulti/db/upgrade.php
Expand Up @@ -38,10 +38,14 @@ function xmldb_qtype_calculatedmulti_upgrade($oldversion) {
// From this version on, answer options may use HTML, so the answerformat does now have a
// meaning. For backwards compatibility, all existing answer options for this question
// type must have their answerformat set to FORMAT_PLAIN.
$DB->execute("UPDATE {question_answers} AS answers, {question} AS questions
SET answerformat = '" . FORMAT_PLAIN . "'
WHERE answers.question = questions.id
AND questions.qtype = 'calculatedmulti'");
$DB->execute("UPDATE {question_answers}
SET answerformat = '" . FORMAT_PLAIN . "'
WHERE question IN (
SELECT id
FROM {question}
WHERE qtype = 'calculatedmulti'
)"
);

// Calculatedmulti savepoint reached.
upgrade_plugin_savepoint(true, 2024011700, 'qtype', 'calculatedmulti');
Expand Down

0 comments on commit 1fdd34a

Please sign in to comment.