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

URL's should still work after saving, eg admin settings / search pages

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      1. go to all of the urls below in the list, and save them. The resulting url should not change, you should be able to copy and paste it and for it to work.

      http://moodle.local/admin/search.php?query=inbound
      http://moodle.local/admin/settings.php?section=messageinbound_mailsettings

      There is actually 3 processes to test for both classes of urls above:

      1) Test saving with values that pass validation - this should save and then redirect to the GET version + success notification
      2) Test saving with values that fail validation - this should be the normal post, but still with correct url + fail notification
      3) Test saving with values that haven't changes - should save nothing then redirect with no notification (which almost feels like an omission)

      Show
      go to all of the urls below in the list, and save them. The resulting url should not change, you should be able to copy and paste it and for it to work. http://moodle.local/admin/search.php?query=inbound http://moodle.local/admin/settings.php?section=messageinbound_mailsettings There is actually 3 processes to test for both classes of urls above: 1) Test saving with values that pass validation - this should save and then redirect to the GET version + success notification 2) Test saving with values that fail validation - this should be the normal post, but still with correct url + fail notification 3) Test saving with values that haven't changes - should save nothing then redirect with no notification (which almost feels like an omission)
    • Affected Branches:
      MOODLE_30_STABLE, MOODLE_31_STABLE
    • Fixed Branches:
      MOODLE_31_STABLE
    • Pull Master Branch:
      MDL-53357-dont-break-urls

      Description

      There are a large class of pages in moodle which after you perform some action end up at a url which isn't a valid url, but where there is actually a url that represents that resource.

      A few examples:

      http://moodle.local/admin/settings.php?section=messageinbound_mailsettings

      after a save becomes:

      http://moodle.local/admin/settings.php

      which if you try to load as a get request will fail. There are multiple situations where this manifests itself:

      1) If a browser is closed and reopens with sessions retained, it will http 'get' the page (it won't attempt to re-post)
      2) You are on a previously posted page, and just hit enter in the url bar to reload it (you want to load the page, not re-post)
      3) You want to cut and paste the url to share with someone, or are using a url syncing browser plugin

      Some web frameworks get around this by always doing a http POST followed by a redirect to GET page which can be safely reloaded. A simpler hybrid strategy is to duplicate the 'view' get parameters into the form post action, which also saves a redirect so is faster.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              brendanheywood Brendan Heywood
              Reporter:
              brendanheywood Brendan Heywood
              Peer reviewer:
              Simey Lameze Simey Lameze
              Integrator:
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              Tester:
              Frédéric Massart Frédéric Massart
              Participants:
              Component watchers:
              Andrew Lyons, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                23/May/16