Not sure when this actually popped up, but just noticed tonight that with the latest dev release, the ImageCache Profiles module is no longer working when RealName is enabled. Normally, that module should be applying an ImageCache preset to the user's profile pictures that appear in nodes (full and teasers) and comments, but with the latest dev release of RealName, the unmodified user profile image is displayed. If RealName is disabled, ImageCache Profiles works again.

Comments

dave reid’s picture

It probably also conflicts with the Gravatar module (and likely this has never worked properly anyway). It's very hard to get multiple modules working together that want to all override template_preprocess_user_picture().

ChrisLaFrancis’s picture

I reversed the changes that were introduced with CVS commit #503494 (revision 1.4.4.75 of realname.module), and everything seems to be back to normal now.

Dave, do you think this is something that can be fixed, or is it just going to be an incompatibility between the two modules?

dave reid’s picture

Well I doubt the ImageCache profile user picture uses the account's real name after you've reversed the changes.

ChrisLaFrancis’s picture

Yep, RealName is working fine. The two modules have been working together without issue since at least August, 2010.

dave reid’s picture

It only worked because it accidentally overwrote the $account->name value which was fixed in #521312: Leaking real name in template_preprocess_user_picture_realname(). I'm working on a better patch.

dave reid’s picture

Status: Active » Needs review
StatusFileSize
new2.48 KB

Here's a patch that:
1. Only does a string_replace for the "@user's picture" string in $variables['picture']. This way we don't need to destroy the current data.
2. Intentionally clone $variables['account'] and set $variables['account']->name to the realname. This will not affect the original object from which $variables['account'] was set to a reference by default, but still allow further implementations of hook_preprocess_user_picture() to work naturally with $account->name.

@fivefrank: Please test this patch out to see if it resolves the problem for you.

Donaldd’s picture

Thanks Dave! Patch in #6 works for me.
D

ChrisLaFrancis’s picture

Also working for me. Thanks for your hard work, Dave.

pvasener’s picture

The patch fixed the problem for me too. Thanks a lot.

danepowell’s picture

Status: Needs review » Reviewed & tested by the community

Phew! Took me 2 hours to trace this problem back to RealName, but happy to report that this patch works. Thanks!

barraponto’s picture

I can confirm the patch works fine.

bohz’s picture

Confirming patch works fine too.
Thanks!

YK85’s picture

subscribing

joelstein’s picture

Works for me.

andypost’s picture

Great idea. I only scare a bit about memory usage caused by cloning mostly for large user lists.

PS We need formalized approach to render user picture to allow contrib to alter parts of final HTML of the image

zanix’s picture

I had the same issue as well, that patch in comment #6 works for me.

Anonymous’s picture

following.

Are there plans to incorporate this patch into a future version?

Thanks!

jzornig’s picture

Patch #6 worked for me.

wxman’s picture

I'm glad I found this thread. I've been going crazy trying to figure out what was wrong. The patch works great here too.

danepowell’s picture

This is obviously a pernicious bug affecting a lot of people- can we get this committed please before it wastes even more peoples' time?

gausarts’s picture

Actually, not only affecting imagecache_profiles, but also imagecache for user pictures in views. Patch #6 works like a charm.

Thanks

metastate’s picture

Updated to RealName 6.x-1.4 and ImageCache presets stopped working for both the ImageCache Profiles module and user pictures in Views - the original, full size photos were showing instead. Patch in #6 fixed the problem.

magnus’s picture

Patch in #6 works great. Thanks!

InTheLyonsDen’s picture

Patch in #6 saved much angst. Thank you!

codekarate’s picture

I am using 6.x-1.4 and the patch in #6 worked for me. Thanks.

dave reid’s picture

Status: Reviewed & tested by the community » Fixed
webkenny’s picture

Two reasons why I love Drupal: Dave and Reid. Next time you're in Boston, beers on me. Took me a step debugger and several attempts to figure out why this was happening. Patch magically fixed it. You're the man.

-K

avolve’s picture

Can confirm that patch#6 works, and that 6.x.1.4 did not work with imagecache profiles.'

Had minor issue with the patch (user error?), though it did work in the end

patch -p1 < realname.patch 
missing header for unified diff at line 8 of patch
can't find file to patch at input line 8
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|Index: realname.module
|===================================================================
|RCS file: /cvs/drupal-contrib/contributions/modules/realname/realname.module,v
|retrieving revision 1.4.4.77
|diff -u -p -r1.4.4.77 realname.module
|--- realname.module	22 Feb 2011 20:19:33 -0000	1.4.4.77
|+++ realname.module	23 Feb 2011 06:28:59 -0000
--------------------------
File to patch: realname.module
patching file realname.module

Much Thanks (tested this module for the first time today).

brunorios1’s picture

Thanks for the patch!

fuu’s picture

Version: 6.x-1.x-dev » 6.x-1.4

After 1 week finally solved this problem.
Keep thinking it is imagecache or viewss problem.
Thanks for the patch.

rot3r1’s picture

Hi!
i have wasted to many day's to understanding what happening to our user picture ,finally i track the issue of realname!
as the large number of, User Based Site using this two specified module (imagecache profile & realname) together , and may be they have this issue, please commit this patch in new version , it will be saving a lot of time and effort!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

mudsurfer’s picture

Sorry, I'm a bit confused because from above I think that the patch suggested in #6 has been incorporated in 6.x-1.4?
However I only just installed Realname for the first time yesterday, using 6.x-1.4, and I am getting the same issues as descibed above.
Using Realname 6.x-1.4
Imagecache_profiles 6.x-1.3
imagecache 6.x-2.0-beta12
Core 6.22

I suppose I should see if I can manually apply the patch at #6 and see if that works?

mudsurfer’s picture

I'm still trying to get used to the Issue queue and the statuses, So forgive me if I'm misplaced, but others may find this if they are searching. I'm definately running Realname 6.x-1.4 and Imagecache_profiles 6.x-1.3; imagecache 6.x-2.0-beta12; Core 6.22.
The patch offered in #6 definately solved my issues. But I had to apply it manually. (im not sure have to roll it into my module automatically yet - still learning!). PS: Great module Dave.

andypost’s picture

Patch incl into 6-dev so 6.x-1.5 will be fine

lelizondo’s picture

It took me a few hours searching what was the problem until I found this. Please release 1.5 as soon as possible since many users will never know that this problem is RealName related and has nothing to do with Imagecache or Views. This module would be the last place anyone would look.

th.sigit’s picture

I had the same problem. I have Drupal Commons installed on my localhost and enabled Real Name module (6.x-1.4) as well. The image won't resize under node pages and user's profile pages.

Upgrading to the last dev fixed this problem. Thanks!

Grzegorz Zbiński’s picture

See also:
http://drupal.org/node/1262572#comment-4964614

Kind of workaround with views, views customfield and imagecache.