From 8357b1d8259cc29e3d960b0abe21b61b2d2b8cd1 Mon Sep 17 00:00:00 2001 From: Matt Meisberger Date: Fri, 8 Jul 2011 17:19:49 -0500 Subject: [PATCH] MDL-28267 fixing bug that hides the html blocks in certain scenarios --- lib/blocklib.php | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/lib/blocklib.php b/lib/blocklib.php index 8cd5a12..15ee4d7 100644 --- a/lib/blocklib.php +++ b/lib/blocklib.php @@ -221,10 +221,16 @@ function blocks_delete_instance($instance,$pinned=false) { // (causing them to calculate their content in the process). Returns true or false. Parameter passed // by reference for speed; the array is actually not modified. function blocks_have_content(&$pageblocks, $position) { + global $USER; if (empty($pageblocks) || !is_array($pageblocks) || !array_key_exists($position,$pageblocks)) { return false; } + + if (!empty($USER->adminediting)) { + return true; + } + // use a for() loop to get references to the array elements // foreach() cannot fetch references in PHP v4.x for ($n=0; $n