Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
After I click on "Add to favorites", then I view it on my user account profile.
The only problem is that it always says "Favorite ... for Anonymous"
I expect something like current username on the title isnt'it?
Comment | File | Size | Author |
---|---|---|---|
#3 | account_user.patch | 771 bytes | kingandy |
Comments
Comment #1
ergelo CreditAttribution: ergelo commentedsubscribing
Comment #2
AppleBag CreditAttribution: AppleBag commentedI've created a fix for this. On line 591, find:
And replace with:
I have noticed there is a similar looking issue on line 548 in the function Favorite Nodes View Teaser, however, I haven't found where on the site to view this to see if it has the Anonymous user problem as well, although admittedly I haven't looked too hard. If the issue is the same, it should just a matter of replacing theme('username', $user) with $user->name
Comment #3
kingandy CreditAttribution: kingandy commentedI suspect what's happened here is that at some point the developers switched the variable from "$account" to "$user" (presumably to make use of the global $user variable). FWIW, I think it would be more appropriate to use "theme('username', $user)" than "$user->name" - the problem is in the variable $account, not the theme('username'). Find attached a patch applying the straight $account to $user switch on Drupal 5.x.
Comment #4
kingandy CreditAttribution: kingandy commentedBy the way, to see the results of theme_favorite_nodes_view_teasers() you have to go to admin/settings/favorite_nodes and select 'Teasers' for the "Type of Page Display for Favorite Nodes" option.