Eloy, need your help & review here 
I have a patch for the LIKE issue that you can see at http://git.catalyst.net.nz/gw?p=moodle-r2.git;a=commitdiff;h=91ac0f5e963c792857b230b54c285a79012704a6 - I think it's pretty safe and I'll commit soon.
The hotpot problem is quite tricky, and it's about quoting rules. If I patch hotpot like this
— a/mod/hotpot/restorelib.php
+++ b/mod/hotpot/restorelib.php
@@ -395,6 +395,7 @@ function hotpot_restore_record(&$restore, $status, &$xml, $table, $foreign_keys,
}
if (empty($record->id)) {
// add the $record (and get new id)
+ error_log(var_export($record,1));
$record->id = insert_record($table, $record);
}
// check $record was added (or found)
I get the following in the error log (all logging redirected there)
stdClass::__set_state(array(
'modtype' => 'hotpot',
'course' => 332,
'name' => 'Newton\\'
's 2nd and 3rd Laws Pretest',
'reference' => 'hotpot/2ndand3rdlawpreptest.htm',
'summary' => 'Quiz',
'timeopen' => '0 ',
'timeclose' => '0 ',
'attempts' => '0 ',
'grademethod' => '1',
'review' => '1',
'grade' => '100',
'timecreated' => '1159128512',
'timemodified' => '1159128512',
'location' => '0 ',
'navigation' => '2',
'outputformat' => '1',
'shownextquiz' => '0 ',
'forceplugins' => '0 ',
'password' => '
'
' ',
'subnet' => '
'
' ',
'clickreporting' => '0 ',
'studentfeedback' => '0 ',
'studentfeedbackurl' => '
'
' ',
'old_id' => '33',
)),
And then Oracle barfs as follows. If you look at those 'empty' fields, it seems like we are getting a doubled-up-quoting in a set of single quotes. I suspect that perhaps the XML in the backup file is bad, and that the handling we have of such strange data is even worse...
ORA-00917: missing comma<br /><br />INSERT INTO m_hotpot ( ID, COURSE, NAME, SUMMARY, TIMEOPEN, TIMECLOSE, LOCATION, REFERENCE, OUTPUTFORMAT, NAVIGATION, STUDENTFEEDBACK, STUDENTFEEDBACKURL, FORCEPLUGINS, SHOWNEXTQUIZ, REVIEW, GRADE, GRADEMETHOD, ATTEMPTS, PASSWORD, SUBNET, CLICKREPORTING, TIMECREATED, TIMEMODIFIED ) VALUES ( 26, 332, 'Newton''s 2nd and 3rd Laws Pretest', 'Quiz', 0, 0, 0, 'hotpot/2ndand3rdlawpreptest.htm', 1, 2, 0, '' ' ', 0, 0, 1, 100, 1, 0, '' ' ', '' ' ', 0, 1159128512, 1159128512 )<ul style="text-align: left"><li>line 1600 of lib/dmllib.php: call to debugging()</li><li>line 399 of mod/hotpot/restorelib.php: call to insert_record()</li><li>line 272 of mod/hotpot/restorelib.php: call to hotpot_restore_record()</li><li>line 117 of mod/hotpot/restorelib.php: call to hotpot_restore_records()</li><li>line 3519 of backup/restorelib.php: call to hotpot_restore_mods()</li><li>line 7151 of backup/restorelib.php: call to restore_create_modules()</li><li>line 47 of backup/restore_execute.html: call t in /home/martin/public_html/moodle-r2.ora/lib/weblib.php on line 6846, referer: http://localhost/~martin/moodle-r2.ora/backup/restore.php
If I tidy up the "empty" fields to be just ' ', SQLPlus likes it a lot more...
Eloy, need your help & review here
I have a patch for the LIKE issue that you can see at http://git.catalyst.net.nz/gw?p=moodle-r2.git;a=commitdiff;h=91ac0f5e963c792857b230b54c285a79012704a6 - I think it's pretty safe and I'll commit soon.
The hotpot problem is quite tricky, and it's about quoting rules. If I patch hotpot like this
— a/mod/hotpot/restorelib.php
+++ b/mod/hotpot/restorelib.php
@@ -395,6 +395,7 @@ function hotpot_restore_record(&$restore, $status, &$xml, $table, $foreign_keys,
}
if (empty($record->id)) { // add the $record (and get new id) + error_log(var_export($record,1)); $record->id = insert_record($table, $record); }
// check $record was added (or found)
I get the following in the error log (all logging redirected there)
stdClass::__set_state(array(
'modtype' => 'hotpot',
'course' => 332,
'name' => 'Newton\\'
's 2nd and 3rd Laws Pretest',
'reference' => 'hotpot/2ndand3rdlawpreptest.htm',
'summary' => 'Quiz',
'timeopen' => '0 ',
'timeclose' => '0 ',
'attempts' => '0 ',
'grademethod' => '1',
'review' => '1',
'grade' => '100',
'timecreated' => '1159128512',
'timemodified' => '1159128512',
'location' => '0 ',
'navigation' => '2',
'outputformat' => '1',
'shownextquiz' => '0 ',
'forceplugins' => '0 ',
'password' => '
'
' ',
'subnet' => '
'
' ',
'clickreporting' => '0 ',
'studentfeedback' => '0 ',
'studentfeedbackurl' => '
'
' ',
'old_id' => '33',
)),
And then Oracle barfs as follows. If you look at those 'empty' fields, it seems like we are getting a doubled-up-quoting in a set of single quotes. I suspect that perhaps the XML in the backup file is bad, and that the handling we have of such strange data is even worse...
ORA-00917: missing comma<br /><br />INSERT INTO m_hotpot ( ID, COURSE, NAME, SUMMARY, TIMEOPEN, TIMECLOSE, LOCATION, REFERENCE, OUTPUTFORMAT, NAVIGATION, STUDENTFEEDBACK, STUDENTFEEDBACKURL, FORCEPLUGINS, SHOWNEXTQUIZ, REVIEW, GRADE, GRADEMETHOD, ATTEMPTS, PASSWORD, SUBNET, CLICKREPORTING, TIMECREATED, TIMEMODIFIED ) VALUES ( 26, 332, 'Newton''s 2nd and 3rd Laws Pretest', 'Quiz', 0, 0, 0, 'hotpot/2ndand3rdlawpreptest.htm', 1, 2, 0, '' ' ', 0, 0, 1, 100, 1, 0, '' ' ', '' ' ', 0, 1159128512, 1159128512 )<ul style="text-align: left"><li>line 1600 of lib/dmllib.php: call to debugging()</li><li>line 399 of mod/hotpot/restorelib.php: call to insert_record()</li><li>line 272 of mod/hotpot/restorelib.php: call to hotpot_restore_record()</li><li>line 117 of mod/hotpot/restorelib.php: call to hotpot_restore_records()</li><li>line 3519 of backup/restorelib.php: call to hotpot_restore_mods()</li><li>line 7151 of backup/restorelib.php: call to restore_create_modules()</li><li>line 47 of backup/restore_execute.html: call t in /home/martin/public_html/moodle-r2.ora/lib/weblib.php on line 6846, referer: http://localhost/~martin/moodle-r2.ora/backup/restore.php
If I tidy up the "empty" fields to be just ' ', SQLPlus likes it a lot more...
's 2nd and 3rd Laws Pretest', 'reference' => 'hotpot/2ndand3rdlawpreptest.htm', 'summary' => 'Quiz', 'timeopen' => '0 ', 'timeclose' => '0 ', 'attempts' => '0 ', 'grademethod' => '1', 'review' => '1', 'grade' => '100', 'timecreated' => '1159128512', 'timemodified' => '1159128512', 'location' => '0 ', 'navigation' => '2', 'outputformat' => '1', 'shownextquiz' => '0 ', 'forceplugins' => '0 ', 'password' => '
'
' ', 'subnet' => '
'
' ', 'clickreporting' => '0 ', 'studentfeedback' => '0 ', 'studentfeedbackurl' => '
'
' ', 'old_id' => '33', )), And then Oracle barfs as follows. If you look at those 'empty' fields, it seems like we are getting a doubled-up-quoting in a set of single quotes. I suspect that perhaps the XML in the backup file is bad, and that the handling we have of such strange data is even worse... ORA-00917: missing comma<br /><br />INSERT INTO m_hotpot ( ID, COURSE, NAME, SUMMARY, TIMEOPEN, TIMECLOSE, LOCATION, REFERENCE, OUTPUTFORMAT, NAVIGATION, STUDENTFEEDBACK, STUDENTFEEDBACKURL, FORCEPLUGINS, SHOWNEXTQUIZ, REVIEW, GRADE, GRADEMETHOD, ATTEMPTS, PASSWORD, SUBNET, CLICKREPORTING, TIMECREATED, TIMEMODIFIED ) VALUES ( 26, 332, 'Newton''s 2nd and 3rd Laws Pretest', 'Quiz', 0, 0, 0, 'hotpot/2ndand3rdlawpreptest.htm', 1, 2, 0, '' ' ', 0, 0, 1, 100, 1, 0, '' ' ', '' ' ', 0, 1159128512, 1159128512 )<ul style="text-align: left"><li>line 1600 of lib/dmllib.php: call to debugging()</li><li>line 399 of mod/hotpot/restorelib.php: call to insert_record()</li><li>line 272 of mod/hotpot/restorelib.php: call to hotpot_restore_record()</li><li>line 117 of mod/hotpot/restorelib.php: call to hotpot_restore_records()</li><li>line 3519 of backup/restorelib.php: call to hotpot_restore_mods()</li><li>line 7151 of backup/restorelib.php: call to restore_create_modules()</li><li>line 47 of backup/restore_execute.html: call t in /home/martin/public_html/moodle-r2.ora/lib/weblib.php on line 6846, referer: http://localhost/~martin/moodle-r2.ora/backup/restore.php If I tidy up the "empty" fields to be just ' ', SQLPlus likes it a lot more...