-
Bug
-
Resolution: Fixed
-
Minor
-
4.4, 4.5, 5.0
The call to add_block_at_end_of_default_region can return null, but if it does, an exception is thrown (block_not_on_page_exception) when find_instance is called.
This can happen if a plugin overrides add_block_at_end_of_default_region and intentionally returns null in order to prevent a user adding a block:
https://moodle.org/plugins/tool_blocksmanager
https://github.com/moodle/moodle/blob/main/blocks/edit_form.php#L434-L452