I have a form which uses a textfield with a custom autocomplete path and it works just as it should. However, I get some unexpected behavior when the title/search string contains a backslash (e.g. '10/07/2016 Meeting').
After some investigation I realized that Drupal seems to interpret those as 4 separate parameters with only the first (in this case 10) being passed to the autocomplete function. I'm not sure how I can prevent this behaviour as the passing of the string to the form is handled internally by Drupal via the
'#autocomplete_path' on the textfield itself.
I checked how entity reference handled this, but it is using an entirely custom field and not the
'#autocomplete_path' on a regular textfield and wasn't of much use to me.
However it would seem odd to me that the textfield autocomplete shouldn't be able to support search strings with slashes - I just can't find out how to hook into the Drupal form to encode the string somehow.
How can I make my autocomplete field compatible with slashes?