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

Images not displaying in question previews

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3
    • Fix Version/s: 2.3
    • Component/s: Filepicker, Quiz
    • Labels:

      Description

      If you create a question in the question bank and put an image in the question text the image will not display correctly when you preview the question. It works fine in the editor but not in the preview window.

      I visited the image URL directly and the following error is displayed.

      Coding error detected, it must be fixed by a programmer: PHP catchable fatal error

      More information about this error

      Debug info: Argument 5 passed to send_stored_file() must be an array, object given, called in /home/andrew/Desktop/code/moodle/int/master/question/previewlib.php on line 259 and defined
      Error code: codingerror
      Stack trace:
      line 397 of /lib/setuplib.php: coding_exception thrown
      line 2272 of /lib/filelib.php: call to default_error_handler()
      line 259 of /question/previewlib.php: call to send_stored_file()
      line 1846 of /lib/questionlib.php: call to question_preview_question_pluginfile()
      line 4005 of /lib/filelib.php: call to question_pluginfile()
      line 38 of /pluginfile.php: call to file_pluginfile()

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            andyjdavis Andrew Davis added a comment -

            If you put an image in question general feedback it doesnt work either.

            Show
            andyjdavis Andrew Davis added a comment - If you put an image in question general feedback it doesnt work either.
            Hide
            marina Marina Glancy added a comment -

            Actually has nothing to do with filepicker, do not know why this component was chosen. But apparently was very easy to fix so I did not re-assign it

            Show
            marina Marina Glancy added a comment - Actually has nothing to do with filepicker, do not know why this component was chosen. But apparently was very easy to fix so I did not re-assign it
            Hide
            poltawski Dan Poltawski added a comment -

            The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week.

            TIA and ciao

            Show
            poltawski Dan Poltawski added a comment - The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week. TIA and ciao
            Hide
            timhunt Tim Hunt added a comment -

            Thanks for trying to fix this Marina, however, this patch should be changed in two ways.

            1. http://docs.moodle.org/dev/Coding_style#Variables - do not use _ in variable names.

            2. This is actually a regression from MDL-32471. Therefore, it would be a smaller fix to change $options to $fileoptions in the argument list and the call to send_stored_file.

            Show
            timhunt Tim Hunt added a comment - Thanks for trying to fix this Marina, however, this patch should be changed in two ways. 1. http://docs.moodle.org/dev/Coding_style#Variables - do not use _ in variable names. 2. This is actually a regression from MDL-32471 . Therefore, it would be a smaller fix to change $options to $fileoptions in the argument list and the call to send_stored_file.
            Hide
            timhunt Tim Hunt added a comment -

            Adding David, so he is aware of the regression he caused.

            Show
            timhunt Tim Hunt added a comment - Adding David, so he is aware of the regression he caused.
            Hide
            poltawski Dan Poltawski added a comment -

            Reopening, based on Tims comments.

            Show
            poltawski Dan Poltawski added a comment - Reopening, based on Tims comments.
            Hide
            timhunt Tim Hunt added a comment -

            Since Marina seems to be busy, I decided to take this and amend the commit. I hope that is OK. It seems to be about the level of work I can cope with given jet-lag

            Show
            timhunt Tim Hunt added a comment - Since Marina seems to be busy, I decided to take this and amend the commit. I hope that is OK. It seems to be about the level of work I can cope with given jet-lag
            Hide
            marina Marina Glancy added a comment -

            Thanks Tim!!!

            Show
            marina Marina Glancy added a comment - Thanks Tim!!!
            Hide
            poltawski Dan Poltawski added a comment -

            Thanks, i've integrated this now.

            Show
            poltawski Dan Poltawski added a comment - Thanks, i've integrated this now.
            Hide
            poltawski Dan Poltawski added a comment -

            Tested and passed. Thanks

            Show
            poltawski Dan Poltawski added a comment - Tested and passed. Thanks
            Hide
            timhunt Tim Hunt added a comment -

            @Marina Phew! I was not sure is I was being interfering or helpful. Looks like I got it right this time.

            Show
            timhunt Tim Hunt added a comment - @Marina Phew! I was not sure is I was being interfering or helpful. Looks like I got it right this time.
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            We could celebrate it today... but better if we perform a bigger party after releasing Moodle 2.3.

            Print this message and come to Perth that day, it's valid for one beer, wine, coke or... water, as you wish.

            Many thanks for your collaboration!

            Ciao

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - We could celebrate it today... but better if we perform a bigger party after releasing Moodle 2.3. Print this message and come to Perth that day, it's valid for one beer, wine, coke or... water, as you wish. Many thanks for your collaboration! Ciao

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  25/Jun/12