-
Bug
-
Resolution: Fixed
-
Major
-
2.4.1
-
MySQL
-
MOODLE_24_STABLE
-
MOODLE_23_STABLE, MOODLE_24_STABLE
-
At around line 4280 (version 2.4.1), there is this database call..
$bprecord = $DB->get_record('block_positions', array('blockinstanceid' => $context->instanceid), 'visible');
The '$fields' parameter is just 'visible'. This is wrong as, AFAIK, there always needs to be a unique field first (usually 'id'). Whenever this line runs it will throw an error...
Did you remember to make the first column something unique in your call to get_records? Duplicate value '1' found in column 'visible'.
line 1032 of /lib/dml/mysqli_native_moodle_database.php: call to debugging()
line 1382 of /lib/dml/moodle_database.php: call to mysqli_native_moodle_database->get_records_sql()
line 1354 of /lib/dml/moodle_database.php: call to moodle_database->get_record_sql()
line 1333 of /lib/dml/moodle_database.php: call to moodle_database->get_record_select()
line 4280 of /lib/filelib.php: call to moodle_database->get_record()
line 38 of /pluginfile.php: call to file_pluginfile()
I am not sure under exactly what circumstances it is called. I have not been able to recreate the problem myself but some of my clients see it. It is related to adding an image to an HTML block.