Needs review
Project:
Gravatar integration
Version:
7.x-1.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
9 May 2012 at 00:56 UTC
Updated:
26 Sep 2022 at 02:47 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
nothinghere commentedNo one try to get Gravatar displayed with a view ?
Comment #2
joshintosh commentedYep, doesn't seem to display Gravatar when you create a user View.
Comment #3
Morten Najbjerg commentedIs this feature on the roadmap for this module? Gravatar through views would be much appreciated.
Comment #4
mavimo commentedPatch attached
Comment #6
luksakThis patch didn't apply. I applied it manually but no field was exposed to views.
I created a first working version of this. Please review my views code since this is my first views handler ever. It would be nice to get some feedback.
Comment #8
smg23 commentedwould be very nice to have this fix working!
Comment #9
yuriy.sychenko commentedGravatar added field in views, but does not show anything unfortunately :(
Comment #10
acouch commentedI rerolled the above patch with the latest dev. I also added the option of being able to use the uploaded picture a user added instead of the Gravatar if the user has uploaded a picture to their profile. That option is off by default.
Comment #12
acouch commentedThis test fails because there is no test. Maybe because of the stub functions here: http://drupalcode.org/project/gravatar.git/blob/refs/heads/7.x-1.x:/grav...
Comment #13
inky@inky3d.com commentedis there any hope for Gravatar images being able to be used in Views?
Comment #14
paulo_graca commentedI've had the same problem, and the way I've tried to fix it was through the views template and gravatar_get_gravatar function:
Comment #15
adshill commented#14 - Can you give more details to how you implemented this?
#12 - Patch applied but doesn't seem to work. I got: The handler for this item is broken or missing and cannot be used. If a module provided the handler and was disabled, re-enabling the module may restore it. Otherwise, you should probably delete this item.
Comment #16
mglamanJust applied patch from #10 against latest dev at it worked.
Comment #17
d.sibaud commentedthe #10 patch it's ok for logged in users, but if I try to show comments (through a relation with Comment: Author and Comment: Content) made by anonymous users with a gravatar linked to the email inserted into the comment form: their gravatar wan't show. As opposite to the node comment thread visualization, where their gravatar are shown.
In some way it is possible to add also a check on the $values->users_comment_mail in the newly created views_handler_gravatar.inc, but the value is not retrieved by the views query. Sure it's more matter of views and comment modules than the gravatar one, but I share my experience here because my first need was born from the gravatar module.
Comment #18
darren ohComment #19
darren ohI can reproduce this bug when I set the picture field to display without a link to the user’s profile page. Views unsets the user ID field in this case, preventing Gravatar from checking user permissions. A workaround is to give the anonymous role permission to use Gravatar. However, uploaded user pictures will always be replaced with the Gravatar.
Comment #21
darren ohIncluding fix for tests from #2218283: gravatar.test missing from .info file.
Comment #22
darren ohComment #23
darren ohComment #24
jacob.embree commentedI can confirm that this patch fixes the issue, but I haven't written any automated tests.
The manual steps to reproduce are:
Observe that before the patch the default images are not displayed, and after the patch they are.
Comment #25
rukayya commentedHi,
You can fix this using views template. Gravatar has it's own function gravatar_get_gravatar using which you can render it within your views template.
I have fixed this as below. I have added below code in my views-myviewname.tpl.php