Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
forms system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
4 Nov 2012 at 04:12 UTC
Updated:
29 Jul 2014 at 21:27 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Crell commentedActually... wouldn't they need to be modified to specify a controller, not a path, and then Drupal takes care of forming the appropriate URL?
Comment #2
disasm commentedHmm... That's an interesting idea...
I was more envisioning they would manually add a route to the module's YAML file, like /taxonomy/autocomplete that specified the controller, and the #autocomplete_path in the form API would just be:
Then we'd modify the AJAX stuff in autocomplete_path to call taxonomy/autocomplete?string=Foo
I am curious more about your idea though. Maybe we can discuss it during the WSCCI meeting tomorrow?
Comment #3
Crell commentedFixing title.
Comment #4
sunKISS?
Didn't update all autocomplete-related tests yet, as I wasn't sure whether this simple solution will be accepted.
Comment #6
effulgentsia commentedWorks for me. Here's test fixes and a couple minor code fixes.
Comment #7
effulgentsia commentedIMO, the DX change above is a wash, but...
The DX of this got much worse, and will be annoying for every contrib module that implements an autocomplete callback. However, I think we'll be able to improve it as we move controllers to the new route system, because the controller will be able to receive $request (or maybe even $query or $q) as a direct parameter. So please, let's not hold this up on that.
Comment #8
sunThanks!
The Views page callback argument handling looks strange, but those two Views callbacks for users and taxonomy terms shouldn't exist in the first place... ;)
Also, we might want to consider to introduce two base Autocomplete controllers in the future; one for single term autocompletion, and the much more interesting, one for autocompleting a term in a text field supporting multiple tags — it looks like we're duplicating quite some complex code there. Lastly, we have an issue somewhere for introducing a generic entity autocomplete route/callback/handler (but I'm unable to find it right now).
Anyway, for now this simple change seems to be required and a long-overdue clean-up and simplification, so I'd think this is ready to go?
Comment #9
Crell commentedComment #10
sunTurns out that ?q= is absolutely great and would make our autocomplete callbacks automatically compatible with #1271622: Seek a better autocomplete replacement for core (jQuery TokenInput / Select2 / Typeahead.js by Twitter) :)
Comment #11
sunActually, I'm not sure what we're waiting for. The patch looks great.
Comment #12
sun#6: drupal8.autocomplete-query.6.patch queued for re-testing.
Comment #13
disasm commentedPatch looks good to me. It's even got some good documentation in core/includes/form.inc. If it's green, I don't see why it isn't ready.
Comment #14
Crell commentedThis looks good to me, too. Any further Symfony-ification can and should happen in follow-up issues.
Comment #15
Crell commentedComment #16
dries commentedCommitted to 8.x. Thanks.
Comment #18
tstoecklerDoes this need a change notice? I would think yes, but I'm not sure. In writing one for #1817656: Let user_autocomplete also find the anonymous user. I wanted to reference this, but there isn't one.
Comment #19
tstoecklerI wrote some code related to this at the top of http://drupal.org/node/1896862 that could probably be stolen for this (and then removed from there).
Comment #20
xjmComment #21
berdirCreated http://drupal.org/node/1901518 and updated the change noticed mentioned in #19.
Comment #22
tim.plunkettThat change notice looks good. Seems to actually be more straightforward for module devs.
Comment #23.0
(not verified) commentedUpdated issue summary.