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

Restore skips blocks that don't allow multiple but have different subpagepattern

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Pre-requisites

      1. Download the attached page block_page.php and place it in the course/ directory
      2. Create a new blank course and not its ID
      3. Add this series of block in the COURSE CONTEXT:
        • Comments (displayed on ANY course page)
        • Calendar (displayed on any type of course main page)
        • Messages (displayed on any type of course main page)
        • Private files (displayed in any forum page)
          1. Add it to the course page
          2. Edit it to be displayed to anywhere
          3. Go to the forum and edit the block
          4. Set it to be displayed on forum pages
        • Online users (displayed in subpage 1)
          1. Go to course/block_page.php?courseid=ID&subpage=1
          2. Add the block Online users there/
      4. Backup the course

      Test

      We will change the location or delete some blocks, and then check that we can restore some blocks but not all of them

      1. Go to course/block_page.php?courseid=ID&subpage=1
      2. Delete the block Online users
      3. Go to course/block_page.php?courseid=ID&subpage=2
      4. Add the block Online users
      5. Delete the Calendar block
      6. Add the Calendar block on the front page and set it to be displayed Throughout the entire site
      7. Go to the forum where the Private files block was added and set it to be displayed on any page
      8. Edit the Messages block to be displayed on the forum page only (see how to in the pre-requisites for the Private files block)
      9. Note the records in mdl_block_instances for the course
      10. Now restore the course as MERGE into itself
      11. Make sure that the following blocks have not been restored (e.g. they should not be duplicated - check original location, and they should not have a new entry in the table)
        • Comments
        • Calendar
        • Private files
      12. Make sure that the following blocks were restored (they are visible, not duplicated, and have a new entry in the DB) - Also check that they appear in both their expected locations
        • Online users
        • Messages

      Test 2

      1. Run (or check CI for the results) lib/tests/blocklib_test.php

      Archived testing instructions

      Ignore the following

      1. Create a new course
      2. Add a block A that can only have one instance per context
      3. Change its settings to be displayed on every sub page and contexts
      4. Back the course including the blocks
      5. Edit the block A and change its setting to only be displayed on the course page
      6. Restore the backup into the same course
      7. Make sure the block has been duplicated
      8. Perform the restore again
      9. Make sure not more blocks were added
      Show
      Pre-requisites Download the attached page block_page.php and place it in the course/ directory Create a new blank course and not its ID Add this series of block in the COURSE CONTEXT: Comments (displayed on ANY course page) Calendar (displayed on any type of course main page) Messages (displayed on any type of course main page) Private files (displayed in any forum page) Add it to the course page Edit it to be displayed to anywhere Go to the forum and edit the block Set it to be displayed on forum pages Online users (displayed in subpage 1) Go to course/block_page.php?courseid=ID&subpage=1 Add the block Online users there/ Backup the course Test We will change the location or delete some blocks, and then check that we can restore some blocks but not all of them Go to course/block_page.php?courseid=ID&subpage=1 Delete the block Online users Go to course/block_page.php?courseid=ID&subpage=2 Add the block Online users Delete the Calendar block Add the Calendar block on the front page and set it to be displayed Throughout the entire site Go to the forum where the Private files block was added and set it to be displayed on any page Edit the Messages block to be displayed on the forum page only (see how to in the pre-requisites for the Private files block) Note the records in mdl_block_instances for the course Now restore the course as MERGE into itself Make sure that the following blocks have not been restored (e.g. they should not be duplicated - check original location, and they should not have a new entry in the table) Comments Calendar Private files Make sure that the following blocks were restored (they are visible, not duplicated, and have a new entry in the DB) - Also check that they appear in both their expected locations Online users Messages Test 2 Run (or check CI for the results) lib/tests/blocklib_test.php Archived testing instructions Ignore the following Create a new course Add a block A that can only have one instance per context Change its settings to be displayed on every sub page and contexts Back the course including the blocks Edit the block A and change its setting to only be displayed on the course page Restore the backup into the same course Make sure the block has been duplicated Perform the restore again Make sure not more blocks were added
    • Affected Branches:
      MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_27_STABLE, MOODLE_28_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-40419-master-2nd
    • Sprint:
      BACKEND Sprint 18

      Description

      The restore_block_instance_structure_step::process_block does a check for if the block allows multiple instances. If it does not, it then checks to see if the block has already been added.

      This second check does not take into account subpagepattern so it skips blocks that would actually be on different pages.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              fred Frédéric Massart
              Reporter:
              bushido Mark Nielsen
              Peer reviewer:
              Simey Lameze
              Integrator:
              Sam Hemelryk
              Tester:
              Damyon Wiese
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                12/Jan/15