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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rares’s picture

Status: Active » Needs review
kbahey’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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

zorp’s picture

Status: Closed (fixed) » Active
FileSize
507 bytes

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.

pavithra’s picture

FileSize
603 bytes

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.