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

Database import URL field error: link directs to /mod/data/url instead of to linked site

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      1. Go to a course
      2. Add a database module
      3. Add "URL" field to the module with "Auto link" checked". Name the field 'url'.
      4. Go to templates > save
      5. Add following entries and make sure you get out put links as mentioned below:-
        1. google.com -> http://google.com
        2. google.com/drive -> http://googble.com/drive
        3. /test -> generates relative url make sure doesn't link to http://test
        4. ftp://bla -> stays the same
      6. Import the attached csv
      7. Make sure the link points to http://google.com
      Show
      Go to a course Add a database module Add "URL" field to the module with "Auto link" checked". Name the field 'url'. Go to templates > save Add following entries and make sure you get out put links as mentioned below:- google.com -> http://google.com google.com/drive -> http://googble.com/drive /test -> generates relative url make sure doesn't link to http://test ftp://bla -> stays the same Import the attached csv Make sure the link points to http://google.com
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_27_STABLE, MOODLE_28_STABLE
    • Fixed Branches:
      MOODLE_27_STABLE, MOODLE_28_STABLE
    • Pull Master Branch:
      MDL-48372-master
    • Sprint:
      Team B Sprint 1

      Description

      The csv url must start with http:// (or ftp://, // etc.) or else it is interpreted as relative and the link is prefixed with the current location. When you save an entry with a url field, the http:// is automatically added if the protocol is missing from the url. Apparently, when you import entries, the module doesn't add the http:// where omitted, and all the imported urls which do not contain the protocol will be relative and broken if intended as absolute. More here: https://moodle.org/mod/forum/discuss.php?d=275694#p1184998

        Attachments

          Issue Links

            Activity

              People

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

                Dates

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