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.
field_view_field fires hook_field_attach_view_alter and passes a context array containing various bits of useful information, however the field name is missing. The field_name is passed inside the $result variable, however if the field contains no content, this variable is NULL. It would be useful to have the field name passed inside $context so that it is available regardless of the status of $result.
Comment | File | Size | Author |
---|---|---|---|
#2 | add_field_name_to_context-2852801-2.patch | 466 bytes | scottpashley |
Comments
Comment #2
scottpashley CreditAttribution: scottpashley commentedComment #3
segi CreditAttribution: segi at Cheppers commentedThanks @scottpashley for patch and that you opened this ticket. My task to show all fields which is in node it doesn't matter the field has value or not. I tried to solved this problem hook_field_attach_view_alter with generated field structure. The context argument contains the display settings but I couldn't identify which field has these settings, because the context didn't have the field name.
Comment #4
segi CreditAttribution: segi at Cheppers commentedComment #5
segi CreditAttribution: segi at Cheppers commented