mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 00:12:56 +02:00
Just a little bit more reobust in the face of badly-behaved blocks
This commit is contained in:
parent
221a85301e
commit
7933cc6be5
@ -154,11 +154,15 @@ function blocks_delete_instance($instance) {
|
||||
// by reference for speed; the array is actually not modified.
|
||||
function blocks_have_content(&$instances) {
|
||||
foreach($instances as $instance) {
|
||||
if(!$instance->visible) {
|
||||
if (!$instance->visible) {
|
||||
continue;
|
||||
}
|
||||
if (!$record = blocks_get_record($instance->blockid)) {
|
||||
continue;
|
||||
}
|
||||
if (!$obj = block_instance($record->name, $instance)) {
|
||||
continue;
|
||||
}
|
||||
$record = blocks_get_record($instance->blockid);
|
||||
$obj = block_instance($record->name, $instance);
|
||||
$content = $obj->get_content();
|
||||
$type = $obj->get_content_type();
|
||||
switch($type) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user