Allow options to be passed to autocomplete element URLs

Created on 17 January 2017, over 8 years ago
Updated 15 February 2023, over 2 years ago

Right now, \Drupal\Core\Render\Element\FormElement::processAutocomplete() allows one to pass a route name and route parameters to the URL generator that will build the autocomplete backend URL, but it does not support URL options (query string parameters and such).

This can be quite limiting in cases like the one I just encountered, where I want to alter the autocompleting entity reference query but only if a certain condition is true on the client side (signaled by the presence of a query string parameter).

I think it would make a nice addition to core for autocompleting form elements to support URL options :)

Feature request
Status

Needs work

Version

10.1

Component
Form 

Last updated 1 day ago

Created by

🇺🇸United States phenaproxima Massachusetts

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024