New image does not update

rockwright - October 26, 2009 - 21:43
Project:ImageCache Profiles
Version:6.x-1.1
Component:Miscellaneous
Category:support request
Priority:normal
Assigned:Unassigned
Status:needs review
Description

I like this module however, when a user uploads a new picture of himself in lieu of the old one, the new is one is present in his user profile page but the old one is also still present in his node pages. The new picture should be in his node pages just like on his profile page. I tried clearing the caches and resetting cron but the results don’t change. I read a review from drupalmodules.com about this module and a user claims a similar problem, “This did not sink up images, so on uploading new images users will often have one image of the new type and another on another area. Not recommended at this time. I hope it becomes better!” How can this problem be fixed?

#1

andypost - October 27, 2009 - 03:00

This problem related to core, not this module. Try to disable imagecache_profiles and change user picture... if you upload file with different extension so your picture is updated!

This caused by core which saves user pictures with a same name picture-[uid].[extension]

#2

rockwright - October 27, 2009 - 09:31

Yep. You hit the nail on the head. For UGC sites, it’s inconvenient for users to have to do something like this and most likely, they’ll be oblivious. Most ordinary users will just upload a JPEG image of themselves and if they’re going to change a photo, most likely the new photo will also be a JPEG. When they save the changes, sometimes they’ll see the new photo and other times, they’ll see the previous photo. Regardless of what they’ll get in their profile page, they will almost always see the old photo in their associated nodes (be it something on which they originally authored or commented). So I did what you said and changed a photo in PNG format and the changes occurred immediately in both the profile and node pages without clearing the caches or resetting cron. I just wish changes to the photos occur immediately without having to change extensions.

#3

andypost - October 28, 2009 - 08:19
Status:active» needs review

Let's try to add suffix for image as datetime

Patch against dev and module with patch (imagecache_profiles.module.txt remove .txt extension)

AttachmentSize
615304_profile_image_time.patch 1.28 KB
imagecache_profiles.module.txt 7 KB

#4

rockwright - October 29, 2009 - 08:57

Awesome, thanks for the good work.

#5

andypost - October 29, 2009 - 09:34

@rockwright please check carefully that no files left after imagecache flush after user changes avatar

Anyway if it works fine so we can put it within ongoing release

#6

rockwright - October 30, 2009 - 05:50

Everything seems to be working like a gem; put it up.

#7

dipen chaudhary - November 25, 2009 - 02:03

Wanted to let know that the patch works after a quick testing.

#8

andypost - November 26, 2009 - 15:27

That's good, suppose now we need a setting for this.

#9

sadist - November 29, 2009 - 14:40

hi.

i'd tested the patch and it works. tho it will display on your browser, there's problem with the log entries. it will report a 404 error as the system will look for a wrong URL.

For example, instead of 'picture-1.jpg?1252920222' it will look for 'picture-1.jpg%3F1252920222'

And I also received this error printed at user's page who never upload their picture (I set to display a default picture)

warning: filemtime() [function.filemtime]: stat failed for no_picture.gif in /home/public_html/sites/all/modules/imagecache_profiles/imagecache_profiles.module on line 62.
warning: filemtime() [function.filemtime]: stat failed for no_picture.gif in /home/public_html/sites/all/modules/imagecache_profiles/imagecache_profiles.module on line 62.

#10

andypost - November 29, 2009 - 19:29

Looks bad, theme_image is encoding URL, second warning could be suppressed by prefixing @filemtime()

 
 

Drupal is a registered trademark of Dries Buytaert.