Skip to content

Conversation

rubanooo
Copy link
Contributor

I have a model with a boolean field active

Say we have 3 languages, English, Dutch and German and the fallback languages for German are Dutch -> English in this order.

The model looks like this:

Language Active
English 1
Dutch -1
German Empty

We would expect the active value of German to be -1 because the fallback language of German is Dutch and the value in Dutch is actually filled in

But because of the check on line 472, it thinks the value is falsy so it needs to check the next language

if ($data = $this->getLocalizedValue($name, $l)) {
    break;
}

In my proposed change we actually check if the field is empty before checking the next language, like is done on line 468

Copy link

Review Checklist

  • Target branch (11.3 for bug fixes, others 11.x)
  • Tests (if it's testable code, there should be a test for it - get help)
  • Docs (every functionality needs to be documented, see here)
  • Migration incl. install.sql (e.g. if the database schema changes, ...)
  • Upgrade notes (deprecations, important information, migration hints, ...)
  • Label
  • Milestone

Copy link

github-actions bot commented Sep 17, 2024

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@rubanooo
Copy link
Contributor Author

I have read the CLA Document and I hereby sign the CLA

Copy link

@ghost ghost added the Pimcore:ToDo label Sep 19, 2024
@kingjia90 kingjia90 changed the base branch from 11.3 to 11.4 October 1, 2024 08:55
@alexz707 alexz707 changed the base branch from 11.4 to 11.5 December 17, 2024 11:25
@kingjia90 kingjia90 added the Bug label Aug 8, 2025
@kingjia90 kingjia90 added this to the 11.5.9 milestone Aug 8, 2025
@kingjia90 kingjia90 self-assigned this Aug 13, 2025
@kingjia90 kingjia90 merged commit 647fcce into pimcore:11.5 Aug 13, 2025
21 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Aug 13, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants