# This patch file was generated by NetBeans IDE # This patch can be applied using context Tools: Apply Diff Patch action on respective folder. # It uses platform neutral UTF-8 encoding. # Above lines and this line are ignored by the patching process. Index: moodle/mod/data/db/install.xml --- moodle/mod/data/db/install.xml Base (1.9.2.2) +++ moodle/mod/data/db/install.xml Locally Modified (Based On 1.9.2.2) @@ -1,5 +1,5 @@ - @@ -35,7 +35,7 @@ - \ No newline at end of file + \ No newline at end of file Index: moodle/mod/data/db/upgrade.php --- moodle/mod/data/db/upgrade.php Base (1.8.2.4) +++ moodle/mod/data/db/upgrade.php Locally Modified (Based On 1.8.2.4) @@ -132,6 +132,20 @@ } } + if ($result && $oldversion < 2007101515) { + // Upgrade all the data->notification currently being + // NULL to 0 + $sql = "UPDATE {$CFG->prefix}data SET notification=0 WHERE notification IS NULL"; + $result = execute_sql($sql); + $table = new XMLDBTable('data'); + $field = new XMLDBField('notification'); + // First step, Set NOT NULL + $field->setAttributes(XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0', 'editany'); + $result = $result && change_field_notnull($table, $field); + // Second step, Set default to 0 + $result = $result && change_field_default($table, $field); + } + return $result; } Index: moodle/mod/data/restorelib.php --- moodle/mod/data/restorelib.php Base (1.27.2.7) +++ moodle/mod/data/restorelib.php Locally Modified (Based On 1.27.2.7) @@ -98,6 +98,12 @@ $database->editany = backup_todb($info['MOD']['#']['EDITANY']['0']['#']); $database->notification = backup_todb($info['MOD']['#']['NOTIFICATION']['0']['#']); + //fix related to MDL-24470: if someone restore a backup previous to this fix it would fail + //if notification = NULL as the column can not be NULL anymore + if (empty($database->notification)) { + $database->notification = 0; + } + // We have to recode the scale field if it's <0 (positive is a grade, not a scale) if ($database->scale < 0) { $scale = backup_getid($restore->backup_unique_code, 'scale', abs($database->scale)); Index: moodle/mod/data/version.php --- moodle/mod/data/version.php Base (1.29.2.8) +++ moodle/mod/data/version.php Locally Modified (Based On 1.29.2.8) @@ -5,7 +5,7 @@ // This fragment is called by /admin/index.php //////////////////////////////////////////////////////////////////////////////// -$module->version = 2007101514; +$module->version = 2007101515; $module->requires = 2007101509; // Requires this Moodle version $module->cron = 60;