ConfigNamesMapper::hasTranslatable has flawed logic

Created on 20 September 2015, over 9 years ago
Updated 16 February 2025, about 2 months ago

Problem/Motivation

While trying to fix 🐛 Entity view/form mode formatter/widget settings have no translation UI Needs review we stumbled upon a problem with the hasTranslatable method in ConfigNamesMapper. When, for example, we have three config objects to be checked in this method, if one of the config objects does not have translatable items, hasTranslatable returns FALSE for all three config items. Furthermore, hasTranslatable Returns TRUE if no config objects are checked.

Proposed resolution

Reverse the logic of the method, returning TRUE if any of the checked config objects have translatable items, analogous to the hasTranslation method.

Remaining tasks

(reviews needed, tests to be written or run, documentation to be written, etc.)

User interface changes

None.

API changes

ConfigNamesWrapper::hasTranslatable will sometimes now return FALSE where they previously returned TRUE and vice versa. Furthermore, ConfigNamesWrapper::hasTranslatable will now return FALSE when there are no config objects to be checked.

Data model changes

None.

🐛 Bug report
Status

Fixed

Version

8.0 ⚰️

Component

config_translation.module

Created by

🇩🇪Germany jan.stoeckler

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

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