Entity reference fields that point to a user have an option ' Include the anonymous user'. If I unselect this, and set the field to use a select list for its widget, then the select list in the entity form shows the anonymous user.

Comments

joachim created an issue. See original summary.

vasike’s picture

Version: 8.2.x-dev » 8.1.x-dev
Assigned: Unassigned » vasike
Status: Active » Needs review
StatusFileSize
new1008 bytes

indeed. there is an issue for the UserSelection's EntityReferenceSelection plugin.

This plugin works for the autocomplete widget as there is name column involved and "Anonymous" has no name.

So actually the issue here is that the buildEntityQuery does not Exclude Anonymous user, if "not included".

and here is patch for this.

p.s. moved to 8.1.x

vasike’s picture

Issue tags: +DCTransylvania
amateescu’s picture

Title: User ref field includes the Anonymous user when include_anonymous is set not to, when using select widget » User ref field includes the Anonymous user when 'include_anonymous' is set not to, when using select widget
Assigned: vasike » Unassigned
Related issues: +#2434697: Remove UserAutocompleteController
StatusFileSize
new1.34 KB
new2.66 KB
new2.63 KB

This bug occurs because the select list widgets do not filter by the label column like the autocomplete one does, and in #2434697: Remove UserAutocompleteController we forgot to add tests for this case. Here's a small test for that.

The fix makes sense. I just made a small cosmetic change in there, so moving straight to RTBC.

amateescu’s picture

Status: Needs review » Reviewed & tested by the community

Oops :)

joachim’s picture

Does this need tests?

amateescu’s picture

It does and I added them in #4 :)

The last submitted patch, 4: 2700405-4-test-only.patch, failed testing.

amateescu’s picture

And they fail/pass as expected.

catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 8.2.x and cherry-picked to 8.1.x. Thanks!

  • catch committed 23f5a1c on 8.1.x
    Issue #2700405 by amateescu, vasike: User ref field includes the...

  • catch committed 43a7432 on 8.2.x
    Issue #2700405 by amateescu, vasike: User ref field includes the...

Status: Fixed » Closed (fixed)

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

rosinegrean’s picture

Issue tags: -DCTransylvania