If an entity reference to a user is left empty the view displays it as "Anonymous" rather than just leaving the output empty, this is caused by format_username() so can be worked around by disabling "Use formatted username", but this means when there are actually users they won't be formatted either.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

MustangGB’s picture

Component: Miscellaneous » user data
Status: Active » Needs work
MustangGB’s picture

MustangGB’s picture

Status: Needs work » Needs review
FileSize
651 bytes

And a patch.

Status: Needs review » Needs work

The last submitted patch, 3: views-2514694-3.patch, failed testing.

rasikap’s picture

Assigned: Unassigned » rasikap
MustangGB’s picture

Assigned: rasikap » Unassigned
Status: Needs work » Needs review
FileSize
653 bytes

Well empty() matches 0, which of course should return the anonymous user.
Manually edited to use the less inclusive is_null() instead.

MustangGB’s picture

Issue summary: View changes

Removing code from summary as there are patches now.

DamienMcKenna’s picture

DamienMcKenna’s picture

Status: Needs review » Reviewed & tested by the community

This feels like an appropriate change.

DamienMcKenna’s picture

Status: Reviewed & tested by the community » Fixed

Committed. Thanks.

Status: Fixed » Closed (fixed)

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