Problem/Motivation
After installing the views_infinite_scroll module and enabling it on same views that have exposed filters infinite scroll doesn't work. I get the error:TypeError: Argument 1 passed to Drupal\Core\Render\BubbleableMetadata::createFromRenderArray() must be of the type array, null given, called in /var/www/html/core/modules/views/src/Controller/ViewAjaxController.php on line 199 in Drupal\Core\Render\BubbleableMetadata::createFromRenderArray() (line 65 of /var/www/html/core/lib/Drupal/Core/Render/BubbleableMetadata.php).
Probably this issue can be reproduced without group or search API modules, but in my case, I get the error on the search views that based on search API and views that based on group content with exposed filters. And I think it can be reproduced in some cases when you will have just view with exposed filters.
This issue is not related to issues with BEF.
How to reproduce
- Install the views_infinite_scroll and group modules
- Enable these modules
- Create a view based on one of provided entities (search API or group content) and add some exposed filters, also try to create view based on some default entity (E.G. basic page) and this entity should be related to group then create a view based on this basic page entity and add group to relations.
- Use "infinite scroll" instead of default pager
- Go to some of these views (E.G. group page with list of related entities - basic page in our case)
- Try to click "load more" and you should get an error in browser console
Proposed resolution
Add an extra condition when a view has exposed filters and override arguments