Download & Extend

Do not display My favorites in profile if there are no favorites

Project:Favorite Nodes
Version:6.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active

Issue Summary

The current behavior is that My favorites are displayed even if there are no favorites, or if the number of favorites to display is set to 0. The attached patch changes this so that the heading is not displayed unless there is something to display.

Note that I have removed line 145
'#value' => theme('item_list', $items),
because $items does not exist in that context.

AttachmentSize
favorite_nodes.module.patch1.26 KB

Comments

#1

Status:active» needs review

#2

Status:needs review» fixed

#3

Status:fixed» closed (fixed)

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

#4

Status:closed (fixed)» active

I had this same issue with the latest version... So went diving into the code and found that the above patch was implemented, but still a empty Favorites with a link to an empty view showed up on user profiile pages.

Found out it was due to the fact that $favorites array was created with content type name and therefor never will be empty.

i have attached a small Hack/patch that fixes it... I'm using it on my site and it works like a charm.

AttachmentSize
favorite_nodes.module.patch 507 bytes

#5

Not working for me. The view function is not returning anything if there are no favorites ti be displayed.
Put in this patch and works for me.

AttachmentSize
favorite_nodes.module.patch 603 bytes