Using view's block display and layout builder does not work.

Created on 10 July 2020, almost 4 years ago
Updated 23 June 2023, about 1 year ago

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-&gt;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.

πŸ› Bug report
Status

Postponed: needs info

Version

1.7

Component

Miscellaneous

Created by

πŸ‡§πŸ‡¬Bulgaria svetoslav.dragoev

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

    Is this still an issue with 2.0.x? If yes, please update the version and set the status active again with clear steps or (best) with a test showing what's broken.

    2.0.x is the active development branch.

    If nobody replies, we should assume this is fixed and close this issue outdated.

    Thanks!

Production build 0.69.0 2024