Problem/Motivation

Not sure if this relates to https://www.drupal.org/project/paragraph_view_mode/issues/3103449 or not, but noticed this issue currently.
Not using Layout builder or Display suite.
I have a paragraph container Banners that accepts 3 different paragraphs to be added through an entity reference field. A view mode for rendering is set to Banner, as one of those paragraphs has multiple view modes as well. In this case, if a referenced paragraph has a Banner view mode - it will be used, otherwise - a Default. And this part works.
But then, another one of those 3 paragraphs, called CTA, have 2 additional view modes, selecting which won't affect anything. A view mode in settings stays "Banner" (but a "Default" is being applied) for that paragraph and is not being overriden by a module.

Steps to reproduce

1. Create a paragraph 1 with an entity reference field to another paragraph 2.
2. Enable a Paragraph view mode field for the referenced paragraph 2.
3. Add a paragraph 2 inside a paragraph 1 and change a view mode on a paragraph 2.
4. See that a Default view mode is being used.

Proposed resolution

A view mode should be always taken from the current paragraph, not a parent.

Comments

YevKo created an issue. See original summary.

sayco’s picture

Status: Active » Postponed (maintainer needs more info)
StatusFileSize
new3.31 MB
new34.58 KB

Hi thank you for reporting, but to me, everything is working as expected. I think something must be wrong with your set up. Do you have all the view modes enabled on the child paragraph types?
Please watch attached video from debugging, and you will see how this is working for me locally. If the issue will still persist try to provide as much details as it's possible, including paragraphs and paragraphs field configuration.

sayco’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)