Active
Project:
Heartbeat
Version:
7.x-1.x-dev
Component:
User interface
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
18 Aug 2011 at 05:55 UTC
Updated:
23 Jan 2016 at 02:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Stalski commentedDo you have time please to check how we can solve this? I don't have much spare time lately.
Thx in advance.
Comment #2
nikkubhai commentedI will surely try to help. :)
Comment #3
dave reidIf this is using the token [user:picture] then it can be fixed in Token.module with #1268238: The [user:picture] token does not fallback to the default picture.
Comment #4
Stalski commentedIndeed, Great.
Comment #5
dave reidComment #6
BeaPower commentedThat fix doesnt seem to work..
Comment #7
cwithout commentedThat issue actually seems unrelated. I might be missing it, but I don't see anywhere the Heartbeat streams use Tokens.
If it is, this still doesn't seem like the same thing. There are places like using views with any style other than "Default" where there is no default fallback image.
But with the heartbeat activity streams, it's actually outputting an incorrect URL. It's aware of the default image path but for some reason it appends it to the path for the activity_avatar styles. I have my default user image set to
/sites/default/files/pictures/default.pngand the user image in the activity stream is output as/sites/default/files/styles/activity_avatar/public//sites/default/files/pictures/default.png.I can't debug it right now, because I have a deadline for tomorrow. But if you're not seeing the default image, check the source HTML. If there's an image path, you can work around it until there's a fix by uploading a copy of your default image to the path that is actually being output.
Comment #8
Stalski commentedThe avatars are shown nicely and it falls back to the user picture in the heartbeat activity messages. The comment user pictures are not though, but I just fixed that one too to fallback to default user picture.
The screenshot will demonstrate what I mean.
Comment #9
nikkubhai commentedGreat. Thanks!
Comment #10
cwithout commentedAfter some debugging, here's the what's happening. For the default user picture to work with core User module (photo on the user page, etc) AND Heartbeat, you have to enter a URI such as
public://pictures/default.png, because Heartbeat relies ontheme_image_style()However, core doesn't require that the picture be within the Drupal files directory.
A URL such as
/any_directory/pictures/default.pngdoes not work with Heartbeat though it works for core. The core user module also lets you use external images likehttp://www.someothersite.com/default.png, which Heartbeat doesn't. (Side note,pictures/default.pngworks for Heartbeat, but not for core -- which is probably by design.)The attached patch brings the user picture rendering in line with how core renders the user pictures. The same could be done where the pictures are rendered on the comments.
(I also noticed the pictures have no alt tag. Technically, they should, since that's a required attribute for img tags, but that's I separate issue. If you want to match what core is doing, you can use alt and title attributes with something like
$alt = t("@user's picture", array('@user' => format_username($variables['heartbeatactivity']->actor)));)Comment #11
BeaPower commentedjust downloaded the recent dev and all is well now...
Comment #12
Stalski commentedI like the proposition very much since I would like to go core on this one. But it the added function " file_valid_uri" ruins everything.
If I use that, it always checks false, leaving me with a default user picture which is much too big. The default core avatar works then and looks exactly the same.
I am investigating this further but for now.
Comment #13
Stalski commentedOk, indeed you need to use public://pictures/default.png , as core only used the image style when written like that.
If not, it will still find the file, but not rendered by image_style. So I can live with that.
It now works properly for comments and activity messages.
I added alt and title as well
Pushed to git. Thx for the patch.
Comment #15
wormz30 commentedI dunno about you guys, but this still isn't working for me. I checked the patch and it predates the one module that is out now. Anyone with any ideas? I also tried patching it manually with the code that's been provided, but still no luck. :(
Comment #16
mohamadaliakbari commentedAlso it can solved by this path: https://drupal.org/node/2047149#comment-7668303
Comment #17
Triumphent commentedAnother way, is to use a view to display the stream. You can then add a user relationship and add the user picture field. :)
Comment #18
logicp commentedThe issue with outputing fields in Views is that heartbeat_comments becomes unavailable