Moodle
  1. Moodle
  2. MDL-27018

Restore - url->external url not decoding internal links

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 2.0.2, 2.1, 2.2
    • Fix Version/s: 2.0.4, 2.1.1
    • Component/s: Backup
    • Labels:
    • Testing Instructions:
      Hide

      #) Create one course with at least one page resource (or any other activity, np)
      #) Copy the URL of the page resource in the browser.
      #) Create one url resource and, both in the intro and the external url fiels, paste the URL copied in the previous step.
      #) Display the url resource and check that the links in the intro and the external url point to the page resource
      #) Backup the course, no users nor other activities needed, just the page and the url activities
      #) Restore the backup into new course
      #) TEST: Display the url resource and check that the links in the intro and the external url point to the page resource in the restored course. No 'PAGEVIEWBYID' must be visible anywhere.

      Show
      #) Create one course with at least one page resource (or any other activity, np) #) Copy the URL of the page resource in the browser. #) Create one url resource and, both in the intro and the external url fiels, paste the URL copied in the previous step. #) Display the url resource and check that the links in the intro and the external url point to the page resource #) Backup the course, no users nor other activities needed, just the page and the url activities #) Restore the backup into new course #) TEST: Display the url resource and check that the links in the intro and the external url point to the page resource in the restored course. No 'PAGEVIEWBYID' must be visible anywhere.
    • Affected Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      mod_url_decode_master
    • Rank:
      16607

      Description

      When you back up a course, links of the form

      http://wwwroot/mod/forum/view.php?id=1234
      http://wwwroot/mod/page/view.php?id=1234

      turn into special codes in backup. This applies both if you use these links in ordinary text such as a Page content, and also if you use them in the 'external url' field of the URL module.

      When you restore, links in the content of the Page module (and in certain other places) are converted correctly. but links in the 'external URL' field of the URL module are not converted, so it tries to link to e.g.:

      http://sm449.vledev2.open.ac.uk/coremoodle/mod/url/$@PAGEVIEWBYID*59@$

      Although it says 'external URL' I don't see a good reason it shouldn't work for an internal URL. But, if is not going to translate this link for some reason, then it should not convert it in backup either (imo).

      The attached backup is an example: it contains two URL links (to a Page and a Forum), which do not work when restored, and also a page which contains in its text two normal text links to the page and forum, which do work correctly when restored.

        Activity

        Hide
        Helen Foster added a comment -

        Sam, thanks for your report. Increasing priority as it's a backup and restore bug.

        Show
        Helen Foster added a comment - Sam, thanks for your report. Increasing priority as it's a backup and restore bug.
        Hide
        Eloy Lafuente (stronk7) added a comment -

        Added testing instructions, fixed versions.

        Problem is restore of url->externalurl is not defined as column to be processed on restore. Just adding it to define_decode_contents() should do the trick and enable link reconstruction to any oher part of the course.

        Show
        Eloy Lafuente (stronk7) added a comment - Added testing instructions, fixed versions. Problem is restore of url->externalurl is not defined as column to be processed on restore. Just adding it to define_decode_contents() should do the trick and enable link reconstruction to any oher part of the course.
        Hide
        Eloy Lafuente (stronk7) added a comment -

        sending to integration!

        Show
        Eloy Lafuente (stronk7) added a comment - sending to integration!
        Hide
        Sam Hemelryk added a comment -

        Thanks Eloy - this has hit integration now

        Show
        Sam Hemelryk added a comment - Thanks Eloy - this has hit integration now
        Hide
        Andrew Davis added a comment -

        Works are described.

        Show
        Andrew Davis added a comment - Works are described.
        Hide
        Sam Hemelryk added a comment -

        Congratulations - this fix has just been released in the weeklies.

        Show
        Sam Hemelryk added a comment - Congratulations - this fix has just been released in the weeklies.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: