Some profile pictures are appended with a 'rev' number and therefore broken after upgrade

Some profile pictures are appended with a 'rev' number and therefore broken after upgrade

by Visvanath Ratnaweera -
Number of replies: 3
Picture of Particularly helpful Moodlers Picture of Translators
Just now upgraded a Moodle 3.1 site to 3.5.3+ (Build: 20181220) on a new server. Went through any complaints whatsoever but I notice now that some profile pictures are broken. Their URLs have the format https://example.com/pluginfile.php/239/user/icon/boost/f1?rev=12345. If I remove the ?rev=12345 from the URL, the picture gets displayed. The odd thing is that only a dozen of users out of about 2000 have this problem.

I have debugging at DEVELOPER level, nothing reported there. Any idea where this 'rev' thing comes from?

Edit: An upgrade to Moodle 3.5.13 (Build: 20200713) did not help.
Average of ratings: -
In reply to Visvanath Ratnaweera

Re: Some profile pictures are appended with a 'rev' number and therefore broken after upgrade

by Ken Task -
Picture of Particularly helpful Moodlers

These dozen users ... did they use Moodle's default icon for a user or did they upload a pic of their own?  f1.png was default icon for a user if I re-call correctly.  Those had a 'shadow person' for lack of an official description ... one was thumb for forums one was full for profile.

URL to the pic in profile of a user ended with

/theme/image.php/boost/core/1594575996/u/f1

when you just viewed the image while looking at the profile.

What do you get/see with the following query:

select * from `mdl_files` where `filename` like "%f1%"

You might have to target the query by finding something similar or unique to those dozen users to see the diff's.

Dunno, really ...

'SoS', Ken

Average of ratings: Useful (1)
In reply to Ken Task

Re: Some profile pictures are appended with a 'rev' number and therefore broken after upgrade

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hi Ken

Thanks! Yes, I thought, I saw this f1 somewhere. ;)

Anyway the broken links are like https://example.com/pluginfile.php/597/user/icon/boost/f1?rev=3143. Note that there is no png, jpeg, ... and this offending rev=number. When I enter https://example.com/pluginfile.php/597/user/icon/boost/f1 (note, no png, jpag, ..) directly in to the browser, I see the picture.

Yes, they have uploaded a real picture, not that "shadow", at least the handful I checked.

I ran 'SELECT filename, filepath, userid from mdl_files WHERE filename LIKE "f1%"' and got a tone (180) records like
| /        | f1.jpg                                   |   NULL |
| / | f1.png | NULL |

Notice that there are both jpg and png.

This could be something falling from the previous theme. The version I upgraded, 3.1, ran Afterburner.
In reply to Visvanath Ratnaweera

Re: Some profile pictures are appended with a 'rev' number and therefore broken after upgrade

by Ken Task -
Picture of Particularly helpful Moodlers

Not sure that user icons were always .png's ... uploads would accept .jpg's and then images would be appropriately sized ... one for profile and one used as a smaller version in forums.    Something like that ... so the rev thang you are seeing might be related.

Sorry ... don't have a fix for ya! :| ... don't have a site where that issue has been reported (not that sites don't have problems ... users just haven't discovered and reported that particular issue.).

'SoS', Ken