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

Blackboard_six question import fails if the same image is used several times in the same question field

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 2.3.5, 2.4.2, 2.5
    • 2.2.7, 2.3.4, 2.4.1
    • Questions
    • None
    • MOODLE_22_STABLE, MOODLE_23_STABLE, MOODLE_24_STABLE
    • MOODLE_23_STABLE, MOODLE_24_STABLE, MOODLE_25_STABLE
    • Hide

      Reproduce the bug in any MOODLE_23_STABLE MOODLE_24_STABLE, master moodle install where this fix is not applied, trying to import the file attached to this issue MDL-37934_testfile.zip using the Blackboard V6+ question import format should produce an error message similar to:
      Can not create file "5/user/draft/994659423///ppg_ppg0211132247_f1q1g1.jpg"
      Now trying to import the same file with the fix applied, one question should be imported without any error message displayed. The resulting question should have the same image once in the question text and twice in the same answer. The image is a small circle (degree sign).
      As the fix is very short and very simple I don't think additional tests are required.

      Show
      Reproduce the bug in any MOODLE_23_STABLE MOODLE_24_STABLE, master moodle install where this fix is not applied, trying to import the file attached to this issue MDL-37934 _testfile.zip using the Blackboard V6+ question import format should produce an error message similar to: Can not create file "5/user/draft/994659423///ppg_ ppg0211132247 _f1q1g1.jpg" Now trying to import the same file with the fix applied, one question should be imported without any error message displayed. The resulting question should have the same image once in the question text and twice in the same answer. The image is a small circle (degree sign). As the fix is very short and very simple I don't think additional tests are required.

      See https://moodle.org/mod/forum/discuss.php?d=191506&parent=964908
      the code is failing if the same image is used several times in the same field of the same question because in store_file_for_text_field function create_file_from_pathname is called several times with the exact same parameters.
      The solution is to check if file exists before trying to create it.

            jmvedrine Jean-Michel Vedrine
            jmvedrine Jean-Michel Vedrine
            Tim Hunt Tim Hunt
            Dan Poltawski Dan Poltawski
            Frédéric Massart Frédéric Massart
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

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