- Issue created by @demeritcowboy
- 🇮🇳India kulpratap2002
- Investigated and confirmed the issue originates from jQuery UI 1.10+ strict method behavior.
- Searched Webform module and custom code for any direct autocomplete('destroy') usage.
- Verified no explicit destroy calls exist — deduced issue happens during Drupal.detachBehaviors().
- Added data('ui-autocomplete') checks before calling .autocomplete('destroy') in patched logic but it also didn’t work.
- Explored related Webform behaviors (webformElementStates, webform.form.js, clientside_validation) for improper destroy usage.
- Validated that validate().destroy() was also unsafe and fixed it using a data('validator') check but it also didn’t work.
Thanks for looking.
If you mean this for item 3, in web/core/misc/autocomplete.js, then what it sounds like is it's removing the element, and then calling destroy on it? It sounds like it shouldn't try to destroy if it just removed it?
detach(context, settings, trigger) { if (trigger === 'unload') { $( once.remove('autocomplete', 'input.form-autocomplete', context), ).autocomplete('destroy'); } },
- 🇬🇧United Kingdom Sophie.SK
We saw this recently but it was combined with another error that prevented the second field from being saved at all:
An AJAX HTTP error occurred. HTTP Result Code: 200 Debugging information follows. Path: /admin/structure/webform/manage/sophie_s_test_webform?ajax_form=1&_wrapper_format=drupal_ajax StatusText: parsererror ResponseText: Warning: foreach() argument must be of type array|object, string given in /var/www/html/docroot/core/lib/Drupal/Component/Utility/NestedArray.php on line 330 Warning: foreach() argument must be of type array|object, string given in /var/www/html/docroot/core/lib/Drupal/Component/Utility/NestedArray.php on line 330
Which we were able to resolve by applying the patch from 🐛 _wrapper_format=drupal_ajax is always added, instead of updated when the param is already available Active .
The autocomplete message still occurs on our sites but we can at least add multiple fields in one pageload now.