MDL-31616 blocks: ensure showinsubcontexts is only 0 or 1 in the DB.
authorTim Hunt <T.J.Hunt@open.ac.uk>
Wed, 16 Jan 2013 12:38:04 +0000 (12:38 +0000)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Wed, 16 Jan 2013 18:16:09 +0000 (19:16 +0100)
lib/blocklib.php

index 682fae1..5066ae5 100644 (file)
@@ -1294,7 +1294,7 @@ class block_manager {
 
             // This may get overwritten by the special case handling below.
             $bi->pagetypepattern = $data->bui_pagetypepattern;
-            $bi->showinsubcontexts = $data->bui_contexts;
+            $bi->showinsubcontexts = (bool) $data->bui_contexts;
             if (empty($data->bui_subpagepattern) || $data->bui_subpagepattern == '%@NULL@%') {
                 $bi->subpagepattern = null;
             } else {