diff --git a/blocks/moodleblock.class.php b/blocks/moodleblock.class.php index 5d87a7cc7c9..71531ef74aa 100644 --- a/blocks/moodleblock.class.php +++ b/blocks/moodleblock.class.php @@ -356,6 +356,15 @@ class block_base { $bc->blockinstanceid = $this->instance->id; $bc->blockpositionid = $this->instance->blockpositionid; + if ($this->instance->visible) { + $bc->content = $this->formatted_contents($output); + if (!empty($this->content->footer)) { + $bc->footer = $this->content->footer; + } + } else { + $bc->add_class('invisible'); + } + $attributes = $this->html_attributes(); if (isset($attributes['id'])) { $bc->id = $attributes['id']; @@ -371,15 +380,6 @@ class block_base { $bc->title = $this->title; } - if ($this->instance->visible) { - $bc->content = $this->formatted_contents($output); - if (!empty($this->content->footer)) { - $bc->footer = $this->content->footer; - } - } else { - $bc->add_class('invisible'); - } - if ($this->page->user_is_editing()) { $bc->controls = $this->page->blocks->edit_controls($this); }