Drupal autocompletion fails for the
#autocomplete_path property if the value to be autocompleted may contain slashes. This is fixed for core taxonomy autocomplete in #93854: Allow autocompletion requests to include slashes, but it may not be clear that contributed modules need to make a similar change.
- Possibly factor out a generic autocomplete helper based on this bit added in #93854: Allow autocompletion requests to include slashes:
// If the request has a '/' in the search text, then the menu system will have
// split it into multiple arguments, recover the intended $tags_typed.
$args = func_get_args();
// Shift off the $field_name argument.
$string = implode('/', $args);
- Document how to support autocompletion of values containing slashes on the
- Decide whether to provide a helper.
- Roll a patch.
- If a helper is provided, add a FAPI test with a dummy module with its own autocompletion, in addition to the existing taxonomy tests? Maybe?
- Possible API addition of a helper function for autocomplete path handling.