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

adding URL resource without an url leads to error

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.0.3, 2.1, 2.2
    • Fix Version/s: 2.0.6, 2.1.3
    • Component/s: Resource
    • Labels:
    • Testing Instructions:
      Hide

      This needs to be tested in all three branches.
      In Stables
      1. Add a URL resource to a page
      2. Make sure URL field is required.
      3. Try entering invalid urls (for example:- hxxp://something) and make sure that generates an error and nothing is saved.
      4. Enter a valid url and Save and return to course
      5. Click on this url resource
      6. Make sure everything works as expected.

      In Master
      1. This patch contains module upgrade code, so make sure the upgrade goes smoothly.
      2. Make sure the field "externalurl" in table "url" is "not-null" after the upgrade.
      3. Repeat 1-6 from above

      Show
      This needs to be tested in all three branches. In Stables 1. Add a URL resource to a page 2. Make sure URL field is required. 3. Try entering invalid urls (for example:- hxxp://something) and make sure that generates an error and nothing is saved. 4. Enter a valid url and Save and return to course 5. Click on this url resource 6. Make sure everything works as expected. In Master 1. This patch contains module upgrade code, so make sure the upgrade goes smoothly. 2. Make sure the field "externalurl" in table "url" is "not-null" after the upgrade. 3. Repeat 1-6 from above
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE
    • Pull Master Branch:
      MDL-28483-master

      Description

      Try adding URL resource into a course (see Testing instructions).

      In 2.0+ the field "External URL" is not required. If user does not enter the value there and tries to click the link, an error occurs with the text "A required parameter (id) was missing", which is very confusing.

      In 1.9 the field "Location" is required and pre-populated with "http://" by default (which does not result in an error if user forgets to fill it). In this case if user clicks on the link from a course page, nothing happens at all.

      IMHO, the link should be required in 2.0+ (and the description field not) and value "http://" should not pass validation in 1.9. But probably there was a good reason why link is no longer required in 2.0+.

      Another thing I have noticed is that help for "Display" lists more options than there are in the dropdown.

        Attachments

        1. MDL-28483_git_diff1.jpg
          MDL-28483_git_diff1.jpg
          284 kB
        2. MDL-28483_git_diff2.jpg
          MDL-28483_git_diff2.jpg
          316 kB
        3. MDL-28483_git_diff3.jpg
          MDL-28483_git_diff3.jpg
          391 kB
        4. Setting up a URL.png
          Setting up a URL.png
          114 kB
        5. URL error.png
          URL error.png
          95 kB

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  28/Nov/11