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

Cannot delete blocks off frontpage

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3.2
    • Fix Version/s: 2.3.3
    • Component/s: Blocks
    • Labels:
    • Testing Instructions:
      Hide
      1. Make sure that the "default home page for users" to be "My Moodle": $CFG->defaulthomepage=1
      2. As site admin, go to front page, <server url>/index.php?redirect=0. It is important to have redirect=0, or else you will be redirected to the "My Moodle" page instead of the frontpage.
      3. Turn editing on
      4. Add a block
      5. Try to delete the block
        1. Verify that you get redirected to confirmation page
      6. Click "Yes"
        1. Verify that you get redirected to the front page
        2. Verify that the block is deleted

      Make sure that no regressions were added by following the regular test instructions for tracker issue: http://tracker.moodle.org/browse/MDL-6424

      Show
      Make sure that the "default home page for users" to be "My Moodle": $CFG->defaulthomepage=1 As site admin, go to front page, <server url>/index.php?redirect=0. It is important to have redirect=0, or else you will be redirected to the "My Moodle" page instead of the frontpage. Turn editing on Add a block Try to delete the block Verify that you get redirected to confirmation page Click "Yes" Verify that you get redirected to the front page Verify that the block is deleted Make sure that no regressions were added by following the regular test instructions for tracker issue: http://tracker.moodle.org/browse/MDL-6424
    • Affected Branches:
      MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      The fix for MDL-6424 caused a regression when trying to delete a block from the front page, when you have the default homepage set to "My Moodle".

      The bug was discovered by our developer, Alfonso Roman:

      I've traced the problem to moodle core file: lib/blocklib.php
       
      There seems to be a typo when a new moodle_url object is created.  They are inserting a '?' which throws off the 'redirect' parameter by making it equal to '0?' instead of '0'. Thin in turn causes a redirect to mysites to happen before the block delete action is performed.
       
      lib/blocklib.php:1161
                 $confirmurl = new moodle_url("$deletepage->url?", array('sesskey' => sesskey(), 'bui_deleteid' => $block->instance->id, 'bui_confirm' => 1));

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              rex Rex Lorenzo added a comment -

              Adrian, do you mind peer reviewing this bug fix for a new feature that you worked on that was added in Moodle 2.3.2?

              Show
              rex Rex Lorenzo added a comment - Adrian, do you mind peer reviewing this bug fix for a new feature that you worked on that was added in Moodle 2.3.2?
              Hide
              salvetore Michael de Raadt added a comment -

              If you're happy with this fix, Adrian, please push it to integration for Rex.

              Show
              salvetore Michael de Raadt added a comment - If you're happy with this fix, Adrian, please push it to integration for Rex.
              Hide
              abgreeve Adrian Greeve added a comment -

              Thanks for spotting this and providing the fix. It looks good to me and doesn't seem to break anything.
              Submitting for integration.

              Show
              abgreeve Adrian Greeve added a comment - Thanks for spotting this and providing the fix. It looks good to me and doesn't seem to break anything. Submitting for integration.
              Hide
              stronk7 Eloy Lafuente (stronk7) added a comment -

              The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week.

              TIA and ciao

              Show
              stronk7 Eloy Lafuente (stronk7) added a comment - The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week. TIA and ciao
              Hide
              poltawski Dan Poltawski added a comment -

              Thanks Rex, good catch.

              Integrated to master and 2.3

              Show
              poltawski Dan Poltawski added a comment - Thanks Rex, good catch. Integrated to master and 2.3
              Hide
              rwijaya Rossiani Wijaya added a comment -

              This is working great.

              Test passed.

              Show
              rwijaya Rossiani Wijaya added a comment - This is working great. Test passed.
              Hide
              poltawski Dan Poltawski added a comment -

              Congratulations, you've done it!

              Thanks, this change is now in the latest weekly release!

              Join the crowds of people tomorrow from 8am and download this Moodle release from your local apple store!

              Show
              poltawski Dan Poltawski added a comment - Congratulations, you've done it! Thanks, this change is now in the latest weekly release! Join the crowds of people tomorrow from 8am and download this Moodle release from your local apple store!

                People

                • Votes:
                  0 Vote for this issue
                  Watchers:
                  0 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    12/Nov/12