Override not working when view mode to override is not selected in the available view mode list

Created on 1 March 2023, almost 2 years ago
Updated 3 January 2024, 12 months ago

Problem/Motivation

https://www.drupal.org/project/paragraphs_viewmode/issues/2971172 πŸ› Does not work with Configuration Translations Fixed seems to have introduced a regression where the view mode is not overriden anymore when the view mode to override is not selected in the list of the available view modes.

In that case the array_search call in https://git.drupalcode.org/project/paragraphs_viewmode/-/tree/8.x-1.x/sr... will return FALSE.

The screenshot below shows an example, where the "Default" view mode is not selected:

Steps to reproduce

Create a site, add the paragraphs and paragraphs_viewmode module.
Create a paragraph type and some view modes
Select some of those view modes as allowable in the "Paragraph view mode" settings
Create a some content with such a paragraph and select a view mode different than "default"
It's rendered with the "default" view mode instead of the selected one

Proposed resolution

Revert the change from https://www.drupal.org/project/paragraphs_viewmode/issues/2971172 πŸ› Does not work with Configuration Translations Fixed and find a better way to handle translations.

Remaining tasks

Create patch.

πŸ› Bug report
Status

Needs review

Version

1.1

Component

Code

Created by

πŸ‡―πŸ‡΅Japan orakili

Live updates comments and jobs are added and updated live.
  • Regression

    It restores functionality that was present in earlier versions.

Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024