Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 UTC on 18 March 2024, to get $100 off your ticket.
Problem/Motivation
Now that we have a generic 'entity_autocomplete' form element, UserAutocompleteController
is just duplicated functionality.
Proposed resolution
Convert its usage to 'entity_autocomplete' and remove all the dead code.
Remaining tasks
None.
User interface changes
User entity reference fields will have new checkbox "Include the anonymous user." in field configuration form.
API changes
A new 'include_anonymous' option is added to the user reference selection plugin.
Beta phase evaluation
Prioritized changes | Follow-up for a critical issue #1959806: Provide a generic 'entity_autocomplete' Form API element. |
---|
Comment | File | Size | Author |
---|---|---|---|
#13 | 2434697-13.patch | 34.29 KB | amateescu |
#8 | interdiff.txt | 423 bytes | amateescu |
#8 | 2434697-8.patch | 34.31 KB | amateescu |
#5 | interdiff.txt | 4.08 KB | amateescu |
#5 | 2434697-5.patch | 34.72 KB | amateescu |
Comments
Comment #1
amateescu CreditAttribution: amateescu commented17 files changed, 115 insertions(+), 380 deletions(-)
Comment #3
pcambraI think the form was making wrong assumptions about the current user being the one checked.
Comment #5
amateescu CreditAttribution: amateescu commentedThanks @pcambra, your patch finally made me realize that the comment behavior is so custom that there's no point in trying to use
EntityAutocomplete::validateEntityAutocomplete()
at all, so I removed that weird new#process_autocomplete_value
stuff in favor of just overriding#element_validate
in CommentForm.Comment #6
Wim LeersAnother lovely diffstat! :)
Comment #7
jibranThis is perfect. Just two nits. Also updated user interface changes in IS.
Out of the scope. :)
I believe we don't have to add that.
Comment #8
amateescu CreditAttribution: amateescu commentedThanks for reviewing :)
Fixed #7.1 and #7.2 is correct, we don't have to but I added it so it's a bit more clear what we're testing.
Comment #9
jibranThank you @amateescu for the patch this is a huge improvement and thank you for clarifying #7.2.
Comment #10
alexpottHow come we're changing the the form element from name to uid? Whereas we're not in CommentForm. I'm not sure that changing it is correct.
But this is meaning less for anything other than selecting users. Feels like this is blocked on #2436835: Unable to create config schema for entity type specific entity reference selection plugin.
Comment #11
amateescu CreditAttribution: amateescu commentedRe #10:
1. The change is correct because the entity autocomplete form element, by default through
EntityAutocomplete::validateEntityAutocomplete()
, returns entity IDs. CommentForm does not use the default behavior of the element, that's why it is not changed.2. The user selection handler already has the 'filter' custom setting that's only used for user entities, which means that #2436835: Unable to create config schema for entity type specific entity reference selection plugin. will have to take the new one into account in a reroll.
Comment #13
amateescu CreditAttribution: amateescu commentedRerolled.
Comment #14
alexpottYep let's handle #10.2 in the other issue.
Committed 3e2af23 and pushed to 8.0.x. Thanks!
Thanks for adding the beta evaluation to the issue summary.
Comment #16
alexpott