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

IMS Common Cartridge import fails when URLs have & in them


    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Minor Minor
    • None
    • 3.3.1
    • Backup: IMS-CC

      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.

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

            Unassigned Unassigned
            drchuck Charles Severance
            0 Vote for this issue
            5 Start watching this issue


                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.