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

feedback import does not work when first line is <?xml version="1.0" encoding="UTF-8"?>

    XMLWordPrintable

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 3.9.11
    • None
    • Feedback
    • MOODLE_39_STABLE

    Description

      While developping a plugin I get problems with the import/export-file for feedback-activity.

      I am not sure but I think the import of feedback-questions does not work correctly.

      In the export-file of feedback the first line is
      <?xml version="1.0" encoding="UTF-8" ?>
      With this line the import works correct.
       
       
      $xmlWriterPlus->startDocument();
      is generation this line <?xml version="1.0" encoding="UTF-8"?>
       
      If there is no space between " and ?> at the end of the line like
      <?xml
      version="1.0" encoding="UTF-8"?>
      then the import does not work.

       
       
      Maybe the pattern does only support the first version:
      function feedback_check_xml_utf8($text) {
      //find the encoding
      $searchpattern = '/^\<?xml.+(encoding=\"([a-z0-9-]*)\").+?\>/is';

      if (!preg_match($searchpattern, $text, $match)) {
      return false; //no xml-file
      }

      //$match[0] = \<? xml ... ?\> (without )
      //
       

       

       

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            moodleaccount A. Schenkel
            Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: