-
Bug
-
Resolution: Fixed
-
Minor
-
3.3, 3.5.3, 3.6.1
-
MOODLE_33_STABLE, MOODLE_35_STABLE, MOODLE_36_STABLE
-
MOODLE_35_STABLE, MOODLE_36_STABLE
-
MDL-59629-master -
If one of your layouts doesn't have regions and default regions, then adding blocks will fail with Coding error.
E.g. example of theme config.
$THEME->layouts = [
|
'mydashboard' => array( |
'file' => 'columns2.php', |
'regions' => array(), |
'options' => array('langmenu' => true), |
];
|
And then error:
Coding error detected, it must be fixed by a programmer: Trying to reference an unknown block region
Debug info:
Error code: codingerror
Stack trace: * line 1047 of /lib/blocklib.php: coding_exception thrown
- line 821 of /lib/blocklib.php: call to block_manager->check_region_is_known()
- line 892 of /lib/blocklib.php: call to block_manager->add_block()
- line 1464 of /lib/blocklib.php: call to block_manager->add_block_at_end_of_default_region()
- line 1390 of /lib/blocklib.php: call to block_manager->process_url_add()
- line 1545 of /lib/pagelib.php: call to block_manager->process_url_actions()
- line 975 of /lib/pagelib.php: call to moodle_page->starting_output()
- line 1087 of /lib/outputrenderers.php: call to moodle_page->set_state()
- line 164 of /my/index.php: call to core_renderer->header()
The issue is in add_block_at_end_of_default_region function. We try to get the last element of the not existing element of array, because $defaulregion is null.