diff --git a/lib/blocklib.php b/lib/blocklib.php
index <HASH>..<HASH> 100644
--- a/lib/blocklib.php
+++ b/lib/blocklib.php
@@ -1285,7 +1285,10 @@ class block_manager {
         } else if ($data = $mform->get_data()) {
             $bi = new stdClass;
             $bi->id = $block->instance->id;
+
+            // This may get overwritten by the special case handling below.
             $bi->pagetypepattern = $data->bui_pagetypepattern;
+            $bi->showinsubcontexts = $data->bui_contexts;
             if (empty($data->bui_subpagepattern) || $data->bui_subpagepattern == '%@NULL@%') {
                 $bi->subpagepattern = null;
             } else {
MDL-<I> block editing: show in subcontexts does not work on category pages.

Thanks to Ian David Wild for pointing to the proper fix.