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.
I have used hierarchical links as formatter at taxonomy field and found that the field label always display in node output even there is no data in field.
I checked the code and have made a quick fix. I will attach a patch here.
Comment | File | Size | Author |
---|---|---|---|
#2 | fix_label_display_problem-1928892-2.patch | 701 bytes | jimmyko |
#1 | fix_label_display_problem-1928892-1.patch | 600 bytes | jimmyko |
Comments
Comment #1
jimmyko CreditAttribution: jimmyko commentedThe patch is pretty simple. I just return a NULL value rather than an empty array at hs_taxonomy_field_formatter_view() when there is no taxonomy term data in field.
EDIT:
This fix is missing the most important thing - the variable! I am going to make a new one instead below.
Comment #2
jimmyko CreditAttribution: jimmyko commentedThis is the corrected patch for 7.x-3.0-alpha5
Comment #3
GoldIt's been a long time since this was reported and I am currently unable to replicate.