mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 09:26:35 +02:00
Just a little bit more reobust in the face of badly-behaved blocks
This commit is contained in:
parent
221a85301e
commit
7933cc6be5
1 changed files with 7 additions and 3 deletions
|
@ -157,8 +157,12 @@ function blocks_have_content(&$instances) {
|
||||||
if (!$instance->visible) {
|
if (!$instance->visible) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$record = blocks_get_record($instance->blockid);
|
if (!$record = blocks_get_record($instance->blockid)) {
|
||||||
$obj = block_instance($record->name, $instance);
|
continue;
|
||||||
|
}
|
||||||
|
if (!$obj = block_instance($record->name, $instance)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$content = $obj->get_content();
|
$content = $obj->get_content();
|
||||||
$type = $obj->get_content_type();
|
$type = $obj->get_content_type();
|
||||||
switch($type) {
|
switch($type) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue