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

Block regions not on current page are shown when configuring blocks

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.8.4, 3.9.1, 3.10, 4.0
    • Fix Version/s: None
    • Component/s: Blocks
    • Labels:
    • Affected Branches:
      MOODLE_310_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE, MOODLE_400_STABLE

      Description

      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.

       

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            bawjaws David Scotson
            Participants:
            Component watchers:
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:

                Time Tracking

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