Affects Version/s: 2.4.1
Component/s: Files API
- On front page, add HTML block with an image.
- Set the block to be display throughout the entire site
- Go to a course
- Move the position of the HTML block to different area (eg: from right to left)
- Go to Front page, and move the postion to different area.
- Refresh the page
- Copy the image url from the block and paste it to a new window
Make sure there's no error occurs for the page.On front page, add HTML block with an image. Set the block to be display throughout the entire site Go to a course Move the position of the HTML block to different area (eg: from right to left) Go to Front page, and move the postion to different area. Refresh the page Copy the image url from the block and paste it to a new window Make sure there's no error occurs for the page.
Fixed Branches:MOODLE_23_STABLE, MOODLE_24_STABLE
Pull from Repository:
Pull Master Branch:
Pull Master Diff URL:
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.