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

Created on 5 May 2017, about 7 years ago
Updated 19 March 2024, 3 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

Needs review

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.69.0 2024