Field config returns translatable === true if on a bundle that is not translatable

Created on 23 March 2015, over 9 years ago
Updated 29 April 2024, 7 months ago

Problem/Motivation

Say you have a field on both the article and basic page bundles but only the article bundle is translatable. Calling isTranslatable() on the field config for the basic page bundle will return true. This is the problem. If the basic page bundle becomes translatable (but not the field itself), isTranslatable() correctly returns false. So basically, as @plach said, the translatability is inherited from the field storage if they are not configured in the UI.

Proposed resolution

I believe it doesn't make sense for a field config to call itself translatable if it is in fact not. But I also probably am missing a lot of context info as to why this is. So it's very much open to discussion.

Remaining tasks

Discuss this issue and come to an agreement on the matter.

User interface changes

None.

API changes

Unclear.

Original report by @Upchuk

🐛 Bug report
Status

Needs work

Version

11.0 🔥

Component
Field 

Last updated about 1 hour ago

Created by

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

    (Drupal 8 Multilingual Initiative) is the tag used by the multilingual initiative to mark core issues (and some contributed module issues). For versions other than Drupal 8, use the i18n (Internationalization) tag on issues which involve or affect multilingual / multinational support. That is preferred over Translation.

Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇺🇸United States DamienMcKenna NH, USA

    I no longer have access to the site this problem first showed up for me, and I haven't ran into the problem on any other site since; that said, every site I work on either has zero translation or one extra language with translation enabled on all content types, I still think the original bug is a valid scenario.

  • Status changed to Needs work 7 months ago
  • 🇦🇺Australia pameeela

    Seems this is still valid, needs an MR with the proposed fix.

  • First commit to issue fork.
  • Merge request !7822Resolve #2457787 "Field config returns" → (Open) created by mahtab_alam
  • Status changed to Needs review 7 months ago
  • Pipeline finished with Failed
    7 months ago
    #159441
  • Status changed to Needs work 7 months ago
  • 🇦🇺Australia pameeela

    Thanks for the MR! There are test fails that need to be looked at.

Production build 0.71.5 2024