-
Bug
-
Resolution: Fixed
-
Major
-
2.2.2
-
MOODLE_22_STABLE
-
MOODLE_21_STABLE, MOODLE_22_STABLE
-
MDL-32104-master -
The "update post" log action in the forum module fails to parse properly when restoring a course.
eg:
module | action | url
|
--------+-------------+----------------------------------------
|
forum | update post | discuss.php?d=3237#p13137&parent=13137
|
forum | update post | discuss.php?d=1532#p6295&parent=6295
|
forum | update post | discuss.php?d=3213#p17623&parent=17623
|
It logs to the backup XML like this:
<log id="3806754">
|
<time>1331694499</time>
|
<userid>44</userid>
|
<ip>129.94.52.74</ip>
|
<module>forum</module>
|
<action>update post</action>
|
<url>discuss.php?d=9020#p31092&parent=31092</url>
|
<info>31092</info>
|
</log>
|
mod/forum/backup/moodle2/restore_forum_activity_task.class.php:114:
$rules[] = new restore_log_rule('forum', 'update post', 'discuss.php?d={forum_discussion}&parent={forum_post}', '{forum_post}');
|
Parses the 'd' parameter as a non-integer which crashes the restore:
Default exception handler: Error reading from database Debug: ERROR: invalid input syntax for integer: "9020#p31092" SELECT * FROM mdl_backup_ids_temp WHERE backupid = $1 AND itemname = $2 AND itemid = $3\n[array (\n 0 => '0b3f2f773e7ac2546690019215ff867a',\n 1 => 'forum_discussion', 2 => '9020#p31092',\n)]
|
* line 394 of /lib/dml/moodle_database.php: dml_read_exception thrown\n* line 232 of /lib/dml/pgsql_native_moodle_database.php: call to moodle_database->query_end()
|
* line 678 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()\n* line 1297 of /lib/dml/moodle_database.php: call to pgsql_native_moodle_database->get_records_sql()
|
* line 1269 of /lib/dml/moodle_database.php: call to moodle_database->get_record_sql()
|
* line 1249 of /lib/dml/moodle_database.php: call to moodle_database->get_record_select()\n* line 1261 of /backup/util/dbops/restore_dbops.class.php: call to moodle_database->get_record()
|
* line 197 of /backup/util/helper/restore_log_rule.class.php: call to restore_dbops::get_backup_ids_record()\n* line 137 of /backup/util/helper/restore_log_rule.class.php: call to restore_log_rule->parse_tokens_and_matches()
|
* line 84 of /backup/util/helper/restore_logs_processor.class.php: call to restore_
|
log_rule->process()
|
* line 1933 of /backup/moodle2/restore_stepslib.php: call to restore_logs_processor->process_log_record()\n* line 131 of /backup/util/plan/restore_structure_step.class.php: call to restore_activity_logs_structure_step->process_log()
|
* line 103 of /backup/util/helper/restore_structure_parser_processor.class.php: call to restore_structure_step->process()
|
* line 130 of /backup/util/xml/parser/processors/grouped_parser_processor.class.php: call to restore_structure_parser_processor->dispatch_chunk()
|
* line 91 of /backup/util/helper/restore_structure_parser_processor.class.php: call to grouped_parser_processor->postprocess_chunk()\n* line 148 of /backup/util/xml/parser/processors/simplified_parser_processor.class.php: call to restore_structure_parser_processor->postprocess_chunk()
|