Grid image mysteriously disapearing

Grid image mysteriously disapearing

by Dan Trockman -
Number of replies: 8
Greeting, I've not seen other reports of this so I'm a bit perplexed, but in at least one of our Grid format courses, the grid images are disappearing. I've only had complaints from one teacher so far and cannot find this in other courses, just one.

We are using:
Moodle 2.5.2+ (Build: 20130913)
Grid 2013110501
PHP 5.3.10-1ubuntu3.7
MySql 5.5.3.2
Any Browser
Theme: Arialist

We have experimented with images large and small, .jpg and .png and different image uploading gui's.

Bottom line, next day, half or more of the 10 sections will have no images and there is no record of images if I look in the inspector, Just says image holder, not URL.

Ideas? Is there something I should look for in the database? Why would img links simply vaporize? I've not seen this in any other way on Moodle 2 or on our site.


Attachment grid.jpg
Average of ratings: -
In reply to Dan Trockman

Re: Grid image mysteriously disapearing

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Dear Dan,

Odd. Please could you expand the highlighted 'div' in the screen shot as it contains more mark-up that is relevant to the issue.  In fact, the URL is within the 'image_holder'.

Was the course there before the upgrade to V2.5.5.1 of the format?  Were some of the images added after the upgrade?

Cheers,

Gareth

In reply to Gareth J Barnard

Re: Grid image mysteriously disapearing

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

P.S. Could you look at and report the content of the 'format_grid_icon' table where the 'courseid' is the same as the 'id=' value in the URL when viewing the course please.

In reply to Gareth J Barnard

Re: Grid image mysteriously disapearing

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

P.P.S.

Working on a hunch, please could you edit 'editimage.php' and change line 81 from:

if (!empty($formdata->deleteimage)) { 

to

if ($formdata->deleteimage === 1) { 

Thanks,

Gareth

In reply to Gareth J Barnard

Re: Grid image mysteriously disapearing

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi all,

Thanks to Dan I have identified that for some reason the displayed image can disappear but the original uploaded image remains.  I do not yet know why or have seen it happen with my test system.  However, a temporary work around is to go into the course settings and change temporarily either the size or the ratio of the image container, save and the images come back.  You can then go back and set it to what you had.

I am looking into it, but it may take a while.  In the mean time, any information you can tell me about when you see images disappear will be helpful.  Like: It happens over night, I deleted another course, I uploaded another image... etc.

Cheers,

Gareth

In reply to Gareth J Barnard

Re: Grid image mysteriously disapearing

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi all,

Nadav has found the cause on CONTRIB-4784 - please be aware of the cause.  I'm looking into it.

Cheers,

Gareth

In reply to Gareth J Barnard

Re: Grid image mysteriously disapearing

by Jane Astley -

Hi All, 

Moodle 2.5.1 (Build: 20130708)
Grid 2013110503
Any Browser
Theme: Anomaly

We have a similar issue with grid images disappearing. It seemed sporadic at first, with only one or two images disappearing from the grid usually overnight. 

In one such example, I replaced the images yesterday and started editing 3 topics this morning (the first and second involved resizing of images within the topic summary and the third was a resizing of an image within a label of a topic).

I returned to the course main page. The grid images had disappeared for the first two topics (with edited topic summary) but all of the other grid images were unaffected. 

If you need any further details please let me know. 

Best wishes,

Jane 

In reply to Jane Astley

Re: Grid image mysteriously disapearing

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Jane,

Thank you.  This is all down to browser caching of images meaning that the image is deleted on the server through the update of section name and or summary but not seen at the client until the image cache setting times out.  Which is why it was so hard to spot.

More details on: CONTRIB-4784.

I have a fix and am in the process of testing.

Cheers,

Garetth

In reply to Gareth J Barnard

Re: Grid image mysteriously disapearing

by Jane Astley -

Hi Gareth,

Thanks so much for the quick reply. 

All the best, 

Jane