gjbarnard / moodle-format_grid

Grid course format contributed by Gareth J Barnard originally created by Paul Krix
GNU General Public License v3.0
21 stars 56 forks source link

"Image information is empty" #199

Closed thepurpleblob closed 5 months ago

thepurpleblob commented 10 months ago

Moodle 4.1.6 Grid: 2022112607

Getting this on one course...

Image information is empty - Image information is empty - itemid > 539521, filename > Steve.png and sectionid > 539521. Please report error details and the information contained in the php.log file to developer..

More information about this error Debug info: Error code: noimageinformation Stack trace:

line 376 of /course/format/grid/classes/toolbox.php: moodle_exception thrown
line 230 of /course/format/grid/classes/toolbox.php: call to format_grid\toolbox::generate_image()
line 157 of /course/format/grid/classes/toolbox.php: call to format_grid\toolbox->setup_displayed_image()
line 118 of /course/format/grid/classes/output/courseformat/content.php: call to format_grid\toolbox->check_displayed_image()
line 504 of /lib/outputrenderers.php: call to format_grid\output\courseformat\content->export_for_template()
line 108 of /course/format/classes/output/section_renderer.php: call to plugin_renderer_base->render()
line 67 of /course/format/grid/format.php: call to core_courseformat\output\section_renderer->render()
line 284 of /course/view.php: call to require()

It's preventing the course page from displaying at all :(

I've done nothing at all (yet) to investigate this but thought I would raise a ticket in case you have any ideas :)

gjb2048 commented 10 months ago

Please attach steve.png - the exact file that causes and you know causes the problem.

gjb2048 commented 10 months ago

Dear @thepurpleblob,

Test file:

null

being:

Screenshot 2024-01-18 213531

that gives:

Screenshot 2024-01-18 214049

with improved reporting: https://github.com/gjbarnard/moodle-format_grid/commit/fa913b1ec3d51e591c67233bfe3fce7ac8753180 - but essentially the same.

Therefore I suspect that the user has uploaded a file that is not a valid image. Patching with the improved error reporting will tell you the user id of the image uploader so that you can take your questioning further with them.

If indeed this is the case, then I would like a demonstration of appreciation for the support I have provided.

Gareth

thepurpleblob commented 10 months ago

Thanks for your enthusiasm here. I kind of assumed pilot error. I'm still waiting to get hold of the actual file from the person reporting the problem.

gjb2048 commented 10 months ago

Enthusiasm, no, annoyance, yes, as I was considering a release and now this is a spanner in the works.

thepurpleblob commented 10 months ago

I've had no response from our member of staff, so I dug the file out of filedir. Unless I've screwed up (!), Steve.png is, in fact, a PDF document (renamed)...

steve

gjb2048 commented 10 months ago

Ok, so given this is there the possibility that the user has done this on purpose to annoy you? If so then please tell the 'adult' to grow up, that actions have consequences and would they like to financially compensate me for my time?

thepurpleblob commented 10 months ago

I doubt it... it's unusual for a member of staff, but we frequently have students who think they can convert a document from (say) .docx to .pdf simply by changing the extension. It's a tough world out there!

I have no access to funding; I can only thank you for your time. I must owe you several beers if we are ever in the same place at the same time!

gjb2048 commented 10 months ago

Dear @thepurpleblob,

Thank you for letting me know and offering beer. Perhaps your employer would consider sponsoring me? I think I may have asked in the past, but am asking again as I'm self employed and all of this support is on my own time.

Gareth

gjb2048 commented 10 months ago

Dear @thepurpleblob,

The patch https://github.com/gjbarnard/moodle-format_grid/commit/4dbedc15aba9f7da9283746274dcb075a39cfadb now does this:

Screenshot 2024-01-19 164246

So that you'll be able to repair what's been broken on the course more easily. I've also removed the user id (GDPR probably gets annoyed about this in the screen output), so now the files table id can be easily seen and then used by an authorised person to find the record and get the id of the user, track them down and then make enquiries.

G

thepurpleblob commented 10 months ago

Thanks again.

Unfortunately, I can't change my code (reams of paperwork and permission from a committee required). I just deleted it out of the files table. A bit brutal but got the course working again.

gjb2048 commented 10 months ago

Dear @thepurpleblob,

Oh the paperwork! I'm intending to do a Moodle dot org release soon, so that should bypass the 'committee'.

G

gjb2048 commented 10 months ago

Dear @thepurpleblob,

I hope you're alright with storm Isha. I've been thinking and perhaps I can send a begging eMail to your boss / people who do have financial authority asking for sponsorship for the support I'm giving. To this end, would it be possible to have some contact details please? Do see https://github.com/gjbarnard/moodle-format_grid/blob/main/Support.md for my eMail / non-public ways of contacting me.

Gareth

gjb2048 commented 5 months ago

Fixed.