Problem/Motivation
We are using multiple views to generate a search result using single textfield. It was working when we were on Drupal 8.9 and using views_autocomplete_api 8.x-1.0 version.
We have recently shifted to Drupal 9.3.0 and using the latest version i.e views_autocomplete_api 2.1.0-alpha1
We have experienced the below issue -
TypeError: Argument 5 passed to Drupal\views_autocomplete_api\Service\ViewsAutocompleteApiManager::executeViews() must be of the type array, null given, called in modules/contrib/views_autocomplete_api/src/Controller/ViewsAutocompleteApiController.php on line 104 in Drupal\views_autocomplete_api\Service\ViewsAutocompleteApiManager->executeViews() (line 159 of /modules/contrib/views_autocomplete_api/src/Service/ViewsAutocompleteApiManager.php)
Steps to reproduce
We have a simple views exposed form and altered it in hook_form_alter where we have added multiple views.
Proposed resolution
In couple of places I have observed missing checks on index of an empty array and count function used on integer
I have created a patch to fix these errors, feel free to review/correct it.
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| undefined_offset_fix.patch | 1.89 KB | nileema19 |
Comments
Comment #2
lubwn commentedI can confirm your patch works. Thank you! Using Drupal 8.9
Comment #3
a.sinitsa commentedWorks fine on 9.4.5
Comment #4
vladimirausThank you for your contributions. 🎂
Committed. 🚀