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

block_manager::add_blocks() ignores block weight parameter and offset

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2.6, 2.3.3, 2.4, 2.7.5, 2.8.3, 2.9
    • Fix Version/s: 2.7.6, 2.8.4
    • Component/s: Blocks
    • Labels:
    • Testing Instructions:
      Hide
      1. Check the weight of the admin_bookmarks block (it will be 0):

        SELECT * FROM mdl_block_instances WHERE parentcontextid = 1 AND blockname = 'admin_bookmarks';
        

      2. Apply patch.
      3. Create new Moodle installation.
      4. Check the weight of the admin_bookmarks block again (it should be 2):

        SELECT * FROM mdl_block_instances WHERE parentcontextid = 1 AND blockname = 'admin_bookmarks';
        

      5. Add this line to config.php:

        $CFG->defaultblocks_override = 'participants,calendar_month:activity_modules,news_items,calendar_upcoming';
        

      6. Create new course
        1. Confirm participants block between navigation and settings blocks
      Show
      Check the weight of the admin_bookmarks block (it will be 0): SELECT * FROM mdl_block_instances WHERE parentcontextid = 1 AND blockname = 'admin_bookmarks'; Apply patch. Create new Moodle installation. Check the weight of the admin_bookmarks block again (it should be 2): SELECT * FROM mdl_block_instances WHERE parentcontextid = 1 AND blockname = 'admin_bookmarks'; Add this line to config.php: $CFG->defaultblocks_override = 'participants,calendar_month:activity_modules,news_items,calendar_upcoming'; Create new course Confirm participants block between navigation and settings blocks
    • Affected Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE, MOODLE_24_STABLE, MOODLE_27_STABLE, MOODLE_28_STABLE, MOODLE_29_STABLE
    • Fixed Branches:
      MOODLE_27_STABLE, MOODLE_28_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      When you use the add_blocks() function, the weight (block positioning) is ignored in the two ways that it can be provided.

        Attachments

          Activity

            People

            • Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                9/Mar/15