[regression] Entity view block not displayed after #2962166

Created on 24 June 2024, 7 months ago

Problem/Motivation

It seems πŸ› Rendering entity view block on an entity with the same view mode causes recursion infinite loop Fixed causes regressions. I'm experiencing it after updating ctools (4.0.4 => 4.1.0).
In some cases the entity can be rendered more than once during a page load.

In my case this happens with a wysiwyg Media embed, within the body field of a node.
The media itself uses layout builder and renders an "Extra" view mode via ctools.
Stacktraces: https://gist.github.com/vever001/2f68dfae4f38b3ebda7ceefc87247a3b
The 1st call involves metatag and tokens.
And the 2nd call is the normal render (Media embed in the body field in this case).

Steps to reproduce

I am using ctools 3.x-dev and drupal core 10.2.x below.

- Install clean drupal: ./vendor/bin/drush si
- Enable required modules: ./vendor/bin/drush en ctools media media_library layout_builder
- Create a new Media view mode (e.g.: "Extra") and enable it for Media images
- Enable layout builder for the default Image view mode, set 2 columns
-- left: Image field
-- right: ctools Entity view (Media): using the "Extra" view mode
- Enable "Embed Media" for basic HTML + add ckeditor button
- Create a media image + create a page node and embed the image in the "Body" field
> OK, at this point everything works correctly, we see the 2 columns
- Now enable metatag module, and clear cache
> Actual: Only the left column is displayed
> Expected: Both columns should be displayed (with "Extra" view mode ctools block on the right)

Proposed resolution

Looking at the changes from the parent issue, the recursion limit is 1.
This may be too low in some scenarios.
Increase it to 20? and log in case the recursion limit reaches > 20.

Remaining tasks

?

User interface changes

?

API changes

?

Data model changes

?

πŸ› Bug report
Status

Active

Version

3.0

Component

Code

Created by

πŸ‡§πŸ‡ͺBelgium herved

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024