Hello,
We are having issues with infinite scroll when using view's block display (using AJAX) and later on place this block through layout builder in a Content Type page.
View is displayed along with the items and load more button correctly, also the js event for loading ore items is triggered correctly:
`/views/ajax?_wrapper_format=drupal_ajax`
view_name: ....
view_display_id: ....
view_args:
view_path: /node/46
view_base_path: case-studies-list
view_dom_id: 388d60908fbbac19a33ca0a1ee300c6356c130970a395c8dc4f7d058fee6162c
pager_element: 0
page: 1
_drupal_ajax: 1
ajax_page_state[theme]: .....
But it fails with an error:
<em class="placeholder">Error</em>: Call to a member function addMetaData() on string in <em class="placeholder">Drupal\views\Plugin\views\query\Sql->execute()</em> (line <em class="placeholder">1462</em> of <em class="placeholder">/var/www/mac3/docroot/core/modules/views/src/Plugin/views/query/Sql.php</em>)
I tried digging into the issue and it seems some step is skipped because when it reaches docroot/core/modules/views/src/ViewExecutable.php, even though it passes built method where the base structure of the built_info is set:
$this->build_info = [
'query' => '',
'count_query' => '',
'query_args' => [],
];
But no build_info is been set, so when it calls from the same class, line 1426 $this->query->execute($this); and there for Drupal\views\Plugin\views\query\Sql >> $query = $view->build_info['query']; is empty and fail.
If I place the same view block inside the block layout - it works.
If I create a view page - it works.
I have no solution for now, will continue digging, any help would be appreciated. Thanks.