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.
Similar to #1801356: Entity reference autocomplete using routes it might be the time now to implement routing for certain pieces of core. User autocomplete is certainly a good place to start.
Comment | File | Size | Author |
---|---|---|---|
#17 | interdiff.txt | 917 bytes | dawehner |
#17 | drupal-1903684-17.patch | 9.34 KB | dawehner |
#13 | interdiff.txt | 760 bytes | dawehner |
#13 | drupal-1903684-13.patch | 9.45 KB | dawehner |
#11 | interdiff.txt | 2.8 KB | dawehner |
Comments
Comment #1
dawehnerThis does not work yet, because drupal_valid_path() is runned for the actual UI, though a review is highly welcomened.
Comment #3
dawehnerWe certainly don't want to have all the logic in the controller, so what is the route to go?
* Add a UserAutocomplete helper class, which get's it's stuff injected and returns the actual matches? The router controller just takes care about routing json? This seems to be for me the best approach.
Comment #4
dawehnerAdd tag.
Comment #5
dawehnerLet's see.
Comment #7
dawehnerI'm not 100% sure what the best way to do that would be. I guess the actual page controller should be in the container, so it's requirements are injected,
but it seems to be that we should have another class, which contain the logic of how to query for the usernames.
Should this second class be used directly or should that also provide a service?
Comment #8
Crell CreditAttribution: Crell commentedSee my most recent comments on #1801356: Entity reference autocomplete using routes for answers to all of @dawehner's questions. :-)
Comment #9
dawehnerThanks for the really good guidance, I hope this does it as expected.
Comment #10
Crell CreditAttribution: Crell commentedAs with the sister issue, the request should be passed to the controller method, not to the constructor. Otherwise this looks fine.
Comment #11
dawehnerThere we go.
Comment #13
dawehnerSame problem as on the taxonomy issue.
Comment #14
Crell CreditAttribution: Crell commentedIf bot likes, I likes.
Comment #15
jibranI think this is by mistake
same here
Comment #16
Crell CreditAttribution: Crell commentedThat's what I get for reviewing code while I have a cold. Good catch, jibran.
Comment #17
dawehnerGet well soon!
I should have seen that.
Comment #18
jibranRTBC as per #14
Comment #19
webchickLooks good.
Committed to 8.x., I will push once tesbot has caught up a bit.