Layout tab is not available for translated contents by default

Created on 4 March 2024, about 1 year ago

Problem/Motivation

Actually 'I'm not sure it's a bug but probably it's a good thing to clarify it. Currently the access handler of the module is the following:

protected function handleTranslationAccess(AccessResult $result, $operation, AccountInterface $account) {
  $entity = $this->getEntity();
  $field_config = $entity->getFieldDefinition(static::FIELD_NAME)->getConfig($entity->bundle());
  // Access is allow if one of the following conditions is true:
  // 1. This is the default translation.
  // 2. The entity is translatable and the layout is overridden and the layout
  //    field is not translatable.
  return $result->andIf(AccessResult::allowedIf($this->isDefaultTranslation() || ($entity instanceof TranslatableInterface && $this->isOverridden() && !$field_config->isTranslatable())))->addCacheableDependency($entity)->addCacheableDependency($field_config);
}

Let's say we have a multilingual site with two languages: English, German (English is the default one). If I create a content in English then translate to German and I want to edit the German version's layout I have no layout tab because of the access handler. Once I edit the default (English) content then the layout tab comes up at German as well.

Is this behaviour is intentional (I guess so)? What is the reason behind that if that's the case?

Steps to reproduce

See it above.

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇭🇺Hungary junkuncz Budapest

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

Comments & Activities

Production build 0.71.5 2024