docs: #3307367 Update the readme examples for the element and the exposed filter

Issue: https://www.drupal.org/project/autocomplete_deluxe/issues/3307367

The README example for a views exposed filter was written against an older API, so the element rendered but the autocomplete route was never reached, and the auto_crteate_bundle line carried a typo of its own.

Both examples in the FAQ are rewritten against the current code, and a second example shows the same wiring on a form of your own, which is what [#3478746] asks for. The key part is that the selection settings have to be in the entity_autocomplete key value store under their hash before the route is called.

Follows the code Proteo posted on the issue, with the route built through the URL generator and the dead auto_create_bundle line dropped.

Tested on Drupal 11.4 in a scratch module:

  • A form of my own: the element renders, the suggestion list comes back from the controller, a tag is added and the form submits.
  • A view with an exposed taxonomy filter: the element replaces the filter, suggestions come back, and applying the filter with Drupal (7) returns exactly the three nodes tagged with that term.

AI-Generated: Yes

Checkpoints:

  • File an issue
  • Addition/Change/Update/Fix
  • Testing to ensure no regression
  • Automated unit testing coverage
  • Automated functional testing coverage
  • UX/UI designer responsibilities
  • Readability
  • Accessibility
  • Performance
  • Security
  • Developer Documentation
  • User Guide Documentation
  • Reviewed by human
  • Code review by maintainers
  • Full testing and approval
  • Credit contributors
  • Review with the product owner
  • Release notes snippet
  • Release
Edited by Rajab Natshah

Merge request reports

Loading