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

Add block not working with instance_allow_multiple()

XMLWordPrintable

    • MOODLE_400_STABLE, MOODLE_402_STABLE

      When you add a block that has instance_allow_multiple() to return false, then it's correct that when you click "+ Add a block" in the block drawer the specific block is not shown anymore. But I've found two scenarioes where more than one block still is shown.

      1st Scenario, Test Instruction

      • Go to a course
        • Wait a second until the whole page is loaded
      • Click "+ Add a block" in the block drawer
      • Click more than once on a block, that has instance_allow_multiple() set to return false
      • Reload the course

      This should show x amount of blocks, based on how many times you clicked. And remove the block from the options in the "+ Add a block" modal

       

      2nd Scenario, Test Instruction

      • Go to a course
      • Don't wait, and immediately click on "+ Add a block" in the block drawer
      • You should now have been redirected to a new page, with an URL that includes "&bui_addblock"
      • From here you should be able to see all blocks, which has been added and still has instance_allow_multiple() set to return false

      If you click on a block again, this should show x amount of blocks, based on how many times you clicked, again.

      Impatient users could accidentally click it multiple times resulting in a lot of instances that needs to be removed or a course breaking from loading too many blocks, depending on how big the added block is.

       

      I've tested the scenarios above on Moodle 4.0.4+, 4.0.6, 4.0.7 & 4.1

            Unassigned Unassigned
            ara Anders Rasmussen
            Votes:
            3 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:

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