Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-69619

Block regions not on current page are shown when configuring blocks

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor Minor
    • None
    • 3.8.4, 3.9.1, 3.10, 4.0
    • Blocks
    • MOODLE_310_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE, MOODLE_400_STABLE

      If you use the block settings page to move a block, then in the drop down menu for where to position the blocks are block regions not present on the current page.

      For example, when using the classic theme, which has left and right block regions on various pages, but only one of them (side-pre) in the 'incourse' layout used for course activities.

      If you go to forum in a course, turn editing on and add a block, the block config page will offer you the option of "right" as a region to put it, but since there is no "right" region, it will put it into the region set as default (left in this case).

      It would be better if the block menu only showed you the regions that currently exist on the page.

      This is particularly noticeable if you add a custom block region intended only for one particular layout as it will turn up in all of these pages as an option.

      Currently this logic is shared between the default region setting and the "on this page" region setting:

              $regionoptions = $this->page->theme->get_all_block_regions();
              foreach ($this->page->blocks->get_regions() as $region) {
                  // Make sure to add all custom regions of this particular page too.
                  if (!isset($regionoptions[$region])) {
                      $regionoptions[$region] = $region;
                  }
              }
       

      I think the default region should list all the regions on the site as above, but the "on this page" setting should only offer the block regions available on the current page.

       

            Unassigned Unassigned
            bawjaws David Scotson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 10 minutes
                10m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.