Field formatter for field state machine always return the state item value for the entity in the default language

Created on 5 May 2017, over 7 years ago
Updated 6 August 2024, 4 months ago

Problem

In a multilingual site, For a node translated, the field state_machine formatter displays the allowed transitions always from the value of the field state in the node from default language.

Proposal

In the StateTransitionForm which load the entity, load the correct translation of this entity.

$this->entity = $this->entityTypeManager->getStorage($entity_type)->load($entity_id);

will become

$entity = $this->entityTypeManager->getStorage($entity_type)->load($entity_id);
$this->entity = $this->entityRepository->getTranslationFromContext($entity);
🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇫🇷France flocondetoile Lyon

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.

Production build 0.71.5 2024