-
Bug
-
Resolution: Fixed
-
Blocker
-
4.0
-
MOODLE_400_STABLE
-
MOODLE_400_STABLE
-
master_
MDL-73808-question-bank-upgrade-bkp -
When I upgrade my Moodle environment from Moodle 3.9.12 Â (Build: 20220117) or from Moodle 4.0dev+ (Build: 20220129), the upgrade fails.
When I look in the upgrade logfile I see these errors:
[#######################################################
[Exception ignored in shutdown function upgrade_finished_handler: Fout bij het schrijven van de databank
Potential coding error - active database transaction detected during request shutdown:
- line 263 of /lib/dml/moodle_read_slave_trait.php: call to moodle_database->start_delegated_transaction()
- line 1308 of /lib/db/upgradelib.php: call to mysqli_native_moodle_database->start_delegated_transaction()
- line 3912 of /lib/db/upgrade.php: call to upgrade_migrate_question_table()
- line 1875 of /lib/upgradelib.php: call to xmldb_main_upgrade()
- line 196 of /admin/cli/upgrade.php: call to upgrade_core()
 I checked the code in /lib/db/upgrade.php where my upgrade fails:
if ($oldversion < 2022020200.02)
{ // Next, split question records into the new tables. upgrade_migrate_question_table(); // Main savepoint reached. upgrade_main_savepoint(true, 2022020200.02); }And this function where it goes wrong in /lib/db/upgradelib.php:
/**
- Split question table in 2 new tables:
* - question_bank_entries
- question_versions
* - Move the random questions records to the following table:
- question_set_reference
* - Move the question related records from quiz_slots table to:
- question_reference
* - Move the tag related data from quiz_slot_tags to:
- question_references
* - For more information:Â https://moodle.org/mod/forum/discuss.php?d=417599#p1688163
*/
function upgrade_migrate_question_table(): void {
global $DB;
// Maximum size of array.
$maxlength = 30000;
// Array of question_versions objects.
$questionversions = [];
// Array of question_set_references objects.
$questionsetreferences = [];
// The actual update/insert done with multiple DB access, so we do it in a transaction.
$transaction = $DB->start_delegated_transaction(); <= this is the line where the error happens <=
- caused a regression
-
MDL-76509 upgrade from 3.11.11+ to 4.1 shows several "Warning: Creating default object from empty value in /var/www/html/lib/db/upgrade.php on line 2336"
- Closed
-
MDL-76584 Temporary column questionid has incorrect definition
- Closed
- Discovered while testing
-
MDLQA-16397 CLONE - Upgrade test using a big data set with many courses
- Passed
- is blocked by
-
MDL-74143 Error during upgrade 3.9 to 4.0 on Oracle
- Closed
- is duplicated by
-
MDL-74268 Question upgrade throws errors, may cause dataloss(?)
- Closed
- Testing discovered
-
MDL-74255 Quiz 4.0: 'Always latest' version for a question in a quiz should mean 'latest ready version'
- Closed