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

CommentFileSizeAuthor
undefined_offset_fix.patch1.89 KBnileema19

Comments

nileema19 created an issue. See original summary.

lubwn’s picture

I can confirm your patch works. Thank you! Using Drupal 8.9

a.sinitsa’s picture

Status: Active » Reviewed & tested by the community

Works fine on 9.4.5

vladimiraus’s picture

Version: 2.1.0-alpha1 » 2.1.x-dev
Status: Reviewed & tested by the community » Fixed

Thank you for your contributions. 🎂
Committed. 🚀

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • vladimiraus committed 57dea74a on 2.1.x
    [#3255467] fix: Failed to perform search for multiple views
    
    By: lubwn...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.