Permalink
Browse files

MDL-26580 adding some upgrade_set_timeout() calls to 2010080901 upgra…

…de block, upgrades on questions were timing out
  • Loading branch information...
1 parent 4d8bd3f commit f5fa4c0e02051729bc30c8f6d301e01c8244ea99 @nebgor nebgor committed with Sam Hemelryk Apr 5, 2011
Showing with 6 additions and 0 deletions.
  1. +6 −0 lib/db/upgrade.php
View
@@ -5000,6 +5000,8 @@ function xmldb_main_upgrade($oldversion) {
$textlib = textlib_get_instance();
foreach ($rs as $question) {
+ // may take awhile
+ upgrade_set_timeout();
if (empty($question->image)) {
continue;
}
@@ -5078,6 +5080,8 @@ function xmldb_main_upgrade($oldversion) {
FROM {question_answers} qa
JOIN {question} q ON qa.question = q.id');
foreach ($rs as $record) {
+ // may take awhile
+ upgrade_set_timeout();
// Convert question_answers.answer
if ($record->qtype !== 'multichoice') {
$record->answerformat = FORMAT_PLAIN;
@@ -5116,6 +5120,8 @@ function xmldb_main_upgrade($oldversion) {
if ($CFG->texteditors !== 'textarea') {
$rs = $DB->get_recordset('question', array('questiontextformat'=>FORMAT_MOODLE));
foreach ($rs as $record) {
+ // may take awhile
+ upgrade_set_timeout();
$record->questiontext = text_to_html($record->questiontext, false, false, true);
$record->questiontextformat = FORMAT_HTML;
$record->generalfeedback = text_to_html($record->generalfeedback, false, false, true);

0 comments on commit f5fa4c0

Please sign in to comment.