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.
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.
Comment | File | Size | Author |
---|---|---|---|
#5 | favorite_nodes.module.patch | 603 bytes | pavithra |
#4 | favorite_nodes.module.patch | 507 bytes | zorp |
favorite_nodes.module.patch | 1.26 KB | rares |
Comments
Comment #1
rares CreditAttribution: rares commentedComment #2
kbahey CreditAttribution: kbahey commentedComment #4
zorp CreditAttribution: zorp commentedI 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.
Comment #5
pavithra CreditAttribution: pavithra commentedNot 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.