Needs work
Project:
Entity API
Version:
7.x-1.x-dev
Component:
Core integration
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
15 Jun 2012 at 12:28 UTC
Updated:
1 Aug 2012 at 18:35 UTC
Jump to comment: Most recent file
Comments
Comment #1
drunken monkeyI love it when bugs aren't my fault …
The problem here lies in the Entity API module:
This will only return the name entered by the user if the user was logged in, otherwise it returns "Anonymous". It kinda looks like this was done deliberately, but I can't really see a reason, why. (Also, the completely effect-less
$name =at the beginning of the line confuses me.)Therefore, I'm leaving this as a bug report. I hope fago will be able to tell you more.
The first attached patch always just returns the entered name, which I'd say is what is expected of the property getter.
The second is my guess at what the special case's intention could've been – only use the entered name for anonymous users and use the user name for users which are logged in.
Comment #2
jtbayly commentedI tested the first patch. I think it is the appropriate one, since the second patch (the special case one) could produce confusion and unexpected values.
The patch works fine, of course. Very simple, straightforward change.
Thanks for the help,
-Joseph
Comment #3
fagoI think the first patch is fine. committed that, thanks.
Comment #4
damien tournoud commentedActually, to be consistent with what core does, we should append "(not verified)" to the user name if
$comment->uidis empty.Comment #5
jtbayly commentedI personally don't like that idea, since actually, that's *not* the commenter name as they left it. It's messing up the commenter name, and forcing me to un-mess it later.
Yes, I know that's how core does it. It irritates me there, too. :)
This is one place where I'd say to forget consistency.
-Joseph
Comment #6
drunken monkeyI'd also be with jtbayly here. Core appends it when viewing the names, not internally. We are adding internal API functions here, which I think should return the data in a more basic form – as it's only used in code, not directly to display the name somewhere, whoever uses it can still attach that suffix, if they want.
Comment #7
majidkh commentedI cannot find modules/callbacks.inc file,
I am using Drupal 7, am I doing anything wrong?
Comment #7.0
majidkh commentedreworded & clarified