mirror of
https://github.com/moodle/moodle.git
synced 2025-01-29 19:50:14 +01:00
Improved error handling a bit.
This commit is contained in:
parent
ca60b03b34
commit
f184e8311f
@ -105,7 +105,7 @@
|
||||
|
||||
/// Get and sort the existing blocks
|
||||
|
||||
if (!$blocks = get_records('blocks')) {
|
||||
if (false === ($blocks = get_records('blocks'))) {
|
||||
error('No blocks found!'); // Should never happen
|
||||
}
|
||||
|
||||
@ -117,6 +117,11 @@
|
||||
$blockbyname[$blockobject->get_title()] = $block->id;
|
||||
$blockobjects[$block->id] = $blockobject;
|
||||
}
|
||||
|
||||
if(empty($blockbyname)) {
|
||||
error('One or more blocks are registered in the database, but they all failed to load!');
|
||||
}
|
||||
|
||||
ksort($blockbyname);
|
||||
|
||||
/// Print the table of all blocks
|
||||
|
Loading…
x
Reference in New Issue
Block a user