Drupal 7.39 added a new required attribute to the $element: #autocomplete_input. This attribute is added by a new function in core includes/form.inc, form_process_autocomplete().
There are two possible places to add a function_exists() check and a call to form_process_autocomplete(). One alternative is in function entity_autocomplete_element_info(), where #process can refer to both entity_autocomplete_element_process() and form_process_autocomplete(). This works, but is cosmetically unattractive, with a ternary operator inside a return array.
The other alternative is to add the code at the end of entity_autocomplete_element_process(). This works as well, and is clearer to understand.
Other contributed modules have addressed this issue in similar fashion. See https://www.drupal.org/node/2554553 (entityreference_autocomplete) and https://www.drupal.org/node/2558605 (autocomplete_widgets), for example.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | autocomplete_in_7.39-2597319-1.patch | 600 bytes | Robert_T |
Comments
Comment #2
Robert_T commentedPatch file for review and testing.
Comment #3
b-prod commentedThanks for your patch, I will review it soon.
Comment #5
b-prod commentedNew release created to handle this compatibility issue with new versions of Drupal.