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

Incorrectly parsed uploaded text file with BOM

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2.2
    • Fix Version/s: 2.1.7, 2.2.4, 2.3.1
    • Component/s: Questions
    • Labels:
    • Testing Instructions:
      Hide

      1. Import the attached file. You should get 5 questions in Russian.
      2. Import any other GIFT files you can find. For example question/format/gift/simpletest/fixtures/questions.gift.txt, and make sure there are no errors.

      Show
      1. Import the attached file. You should get 5 questions in Russian. 2. Import any other GIFT files you can find. For example question/format/gift/simpletest/fixtures/questions.gift.txt, and make sure there are no errors.
    • Affected Branches:
      MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE, MOODLE_23_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      1. Create txt file with BOM in GIFT format (see pic.1)
      2. Import it to the question bank
      3. See preview (pic.2) and example without BOM (pic.3). It can be seen incorrectly parsed title ::Moodle::

      also http://docs.moodle.org/22/en/GIFT_format#Format_symbols

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            timhunt Tim Hunt added a comment -

            I think https://github.com/timhunt/moodle/compare/master...MDL-33780 is the required fix.

            Konstantin, do you have an example GIFT file with a BOM that we can use to test this? If so, please could you attach it here. Thanks.

            Show
            timhunt Tim Hunt added a comment - I think https://github.com/timhunt/moodle/compare/master...MDL-33780 is the required fix. Konstantin, do you have an example GIFT file with a BOM that we can use to test this? If so, please could you attach it here. Thanks.
            Hide
            kostochkin Konstantin Gorshkov added a comment -

            Thank you for your reply. This fix works fine.

            I attached the file with a BOM to the first post.

            Show
            kostochkin Konstantin Gorshkov added a comment - Thank you for your reply. This fix works fine. I attached the file with a BOM to the first post.
            Hide
            timhunt Tim Hunt added a comment -

            Right, it seems to be working.

            Note that the patch for 2.1 is different, because of the changes to textlib.php.

            Show
            timhunt Tim Hunt added a comment - Right, it seems to be working. Note that the patch for 2.1 is different, because of the changes to textlib.php.
            Hide
            timhunt Tim Hunt added a comment -

            Re-based and 2.3 branch added.

            Show
            timhunt Tim Hunt added a comment - Re-based and 2.3 branch added.
            Hide
            poltawski Dan Poltawski added a comment -

            Integrated into master, 23, 22, 21.

            Thanks Tim!

            Show
            poltawski Dan Poltawski added a comment - Integrated into master, 23, 22, 21. Thanks Tim!
            Hide
            rajeshtaneja Rajesh Taneja added a comment -

            Works great, no error encountered.
            Thanks for fixing this, Tim.

            Show
            rajeshtaneja Rajesh Taneja added a comment - Works great, no error encountered. Thanks for fixing this, Tim.
            Hide
            samhemelryk Sam Hemelryk added a comment -

            Congratulations your code is upstream - gold star for you!

            This issue + 79 others made it in in time for the minor releases.
            Thank you everyone involved for your exuberant efforts.

            Show
            samhemelryk Sam Hemelryk added a comment - Congratulations your code is upstream - gold star for you! This issue + 79 others made it in in time for the minor releases. Thank you everyone involved for your exuberant efforts.

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  9/Jul/12