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.
Problem
- I have an entity type which has an optional user reference property (name uid, type integer).
- Entity API adds the relationship handler to said field so we can left join the {users} table.
- Upon left joining, I have some rows with an empty uid
- Using the "User: Name" field will return "Anonymous" instead of nothing
Cause
The field handler views_handler_field_user_name
does not take into account that the UID may be NULL
Solution
Make the handler respect NULL values
Comment | File | Size | Author |
---|---|---|---|
#2 | views-2813033-2.patch | 1.21 KB | kristiaanvandeneynde |
Comments
Comment #2
kristiaanvandeneyndeThe code in that handler could use a bit more love, but this'll do.
Comment #3
johnennew CreditAttribution: johnennew at Deeson commentedWorks as described
Comment #4
DamienMcKennaCommitted. Thanks.