Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-26223 prevent getting content of hidden blocks in edit mode

  • Loading branch information...
commit 9c14c1c55b8def5f4e939a2e34a2c8e814d73b87 1 parent d911c72
@skodak skodak authored
Showing with 8 additions and 7 deletions.
  1. +8 −7 blocks/moodleblock.class.php
View
15 blocks/moodleblock.class.php
@@ -209,7 +209,7 @@ function refresh_content() {
}
/**
- * Return a block_contents oject representing the full contents of this block.
+ * Return a block_contents object representing the full contents of this block.
*
* This internally calls ->get_content(), and then adds the editing controls etc.
*
@@ -217,7 +217,7 @@ function refresh_content() {
* {@link html_attributes()}, {@link formatted_contents()} or {@link get_content()},
* {@link hide_header()}, {@link (get_edit_controls)}, etc.
*
- * @return block_contents a represntation of the block, for rendering.
+ * @return block_contents a representation of the block, for rendering.
* @since Moodle 2.0.
*/
public function get_content_for_output($output) {
@@ -243,10 +243,11 @@ public function get_content_for_output($output) {
if ($this->page->user_is_editing()) {
$bc->controls = $this->page->blocks->edit_controls($this);
- }
-
- if ($this->is_empty() && !$bc->controls) {
- return null;
+ } else {
+ // we must not use is_empty on hidden blocks
+ if ($this->is_empty() && !$bc->controls) {
+ return null;
+ }
}
if (empty($CFG->allowuserblockhiding) ||
@@ -620,7 +621,7 @@ function config_print() {
/**
* Can be overridden by the block to prevent the block from being dockable.
- *
+ *
* @return bool
*/
public function instance_can_be_docked() {
Please sign in to comment.
Something went wrong with that request. Please try again.