Merge branch 'feature/MDL-56830' of https://github.com/fwsl/moodle
authorEloy Lafuente (stronk7) <stronk7@moodle.org>
Tue, 13 Dec 2016 11:00:46 +0000 (12:00 +0100)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Tue, 13 Dec 2016 11:00:46 +0000 (12:00 +0100)
1  2 
lib/blocklib.php

diff --combined lib/blocklib.php
@@@ -387,7 -387,10 +387,7 @@@ class block_manager 
              $requiredbythemeblocks = $PAGE->theme->requiredblocks;
          }
  
 -        // We need blocks for behat, till MDL-56614 gets in.
 -        if (defined('BEHAT_SITE_RUNNING')) {
 -            return array('navigation', 'settings');
 -        } else if ($requiredbythemeblocks === false) {
 +        if ($requiredbythemeblocks === false) {
              return array('navigation', 'settings');
          } else if ($requiredbythemeblocks === '') {
              return array();
          if (!in_array($block->name, $undeletableblocktypes)) {
              $undeletableblocktypes[] = $block->name;
              set_config('undeletableblocktypes', implode(',', $undeletableblocktypes));
+             add_to_config_log('block_protect', "0", "1", $block->name);
          }
      }
  
          if (in_array($block->name, $undeletableblocktypes)) {
              $undeletableblocktypes = array_diff($undeletableblocktypes, array($block->name));
              set_config('undeletableblocktypes', implode(',', $undeletableblocktypes));
+             add_to_config_log('block_protect', "1", "0", $block->name);
          }
  
      }