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

IMS Common Cartridge import fails when URLs have & in them

    XMLWordPrintable

    Details

    • Affected Branches:
      MOODLE_33_STABLE

      Description

      When a Web Link or BasicLTI launch URL includes an Ampersand (&) Moodle dies during import with a message like:

      Fatal Error in [tempdir] ../moodle.xml: EntityRef: expecting ';' at line 250

      Tracing things through, the cartridge is XML so the entity version is correct - as Moodle unzips and extracts the cartridge it is mapped back  to "&" but then as Moodle produces the moodle.xml file (also XML) it fails to re-encode from "&" as an entity so something like "&x=42" looks like a malformed "entity" to the XML parser, leading to the error.

      I have attached a two-item cartridge with no ampersands in the urls, and one with ampersands in the URLs.  I have screen shots of the successful import on demo.moodle.net as well as the failed import on demo.moodle.net as well as a look at the moodle.xml file (from a different, larger import) showing what went wrong in moodle.xml.

        Attachments

        1. IMS_CC_11_AMPERSAND.imscc
          3 kB
        2. IMS_CC_11_NORMAL.imscc
          3 kB
        3. MDL-59993-Fail-Import.png
          MDL-59993-Fail-Import.png
          180 kB
        4. MDL-59993-Good-Import.png
          MDL-59993-Good-Import.png
          225 kB
        5. MDL-59993-XML-Oops.png
          MDL-59993-XML-Oops.png
          189 kB
        6. moodle.xml
          184 kB
        7. py4e_export.imscc
          70 kB

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              drchuck Charles Severance
              Participants:
              Component watchers:
              Darko Miletic, Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated: