Skip to content

[Grid] Fix locale fallback and null export for advanced column source fields - #2071

Merged
fashxp merged 4 commits into
2026.3from
fix/advanced-column-source-field-locale
Oct 6, 2026
Merged

fashxp merged 4 commits into
2026.3from
fix/advanced-column-source-field-locale

Conversation

@fashxp

@fashxp fashxp commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

Split out of #2064.

  • Exporting an advanced column with a transformer filled empty localized source fields with the system default language, ignoring the configured fallback languages. The export now behaves the same with or without a transformer. The interactive grid is unchanged.
  • A missing source value exports as '' instead of the string "null".

Regression test wires a real AdapterResolver under AdvancedColumnResolver and fails without the fix.

Verified end to end (demo, 2026.3 + pimcore/studio-ui-bundle#4166)

CSV export of the Car grid in de, advanced column on name with a Trim transformer, cars without a German name ("before" = 2026.3, "after" = this branch):

Setup Name (de) Name advanced (de) before after
no fallback languages empty E-Type (English) empty
de falls back to fr (French name set) Type E (fr) Type E (fr) Type E (fr)
de falls back to fr, no French name empty MK2 (English) empty

"null" export, advanced column on description (empty in every language) with Trim, CSV and XLSX in de:

Car before (CSV / XLSX) after (CSV / XLSX)
MK2, XK140 null / null empty / empty cell
E-Type (English description only) English description / same empty / empty cell

🤖 Generated with Claude Code

fashxp and others added 3 commits October 6, 2026 11:00
… fields

An advanced column's source fields jumped to the class's default
language whenever a transformer was attached, ignoring the configured
fallback chain the same field used without a transformer; a missing
value also exported as the literal string "null". Both now resolve
export-consistently regardless of the transformer pipeline, while the
interactive grid's own plain-column fallback display is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 6, 2026 09:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approved

Static review found no blocking issues in fallback isolation, context restoration, or null handling; tests were not executed.

Review effort: Balanced
Findings: None

What changed in this PR

Aligns advanced-column source-field localization with export behavior while preserving plain grid columns’ default-language fallback.

Changes:

  • Adds shared source-field context to control the extra default-language fallback.
  • Exports missing values as empty strings while preserving nested JSON nulls.
  • Adds regression tests and upgrade notes.
File Description
tests/​Unit/​Grid/​Util/​Trait/​LocalizedValueTraitTest.php Tests fallback behavior.
tests/​Unit/​Grid/​Util/​AdvancedColumnSourceFieldContextTest.php Tests context state tracking.
tests/​Unit/​Grid/​Column/​Resolver/​DataObject/​AdvancedColumnResolverTest.php Tests source context and export values.
tests/​Unit/​Grid/​Column/​Resolver/​DataObject/​AdapterResolverTest.php Tests context-dependent fallback control.
src/​Grid/​Util/​Trait/​LocalizedValueTrait.php Adds a default-language fallback hook.
src/​Grid/​Util/​AdvancedColumnSourceFieldContextInterface.php Defines the source-resolution context contract.
src/​Grid/​Util/​AdvancedColumnSourceFieldContext.php Stores source-resolution state.
src/​Grid/​Column/​Resolver/​DataObject/​AdvancedColumnResolver.php Scopes context and handles null exports.
src/​Grid/​Column/​Resolver/​DataObject/​AdapterResolver.php Suppresses extra fallback for source fields.
doc/​02_Installation_and_Configuration/​05_Upgrade.md Documents behavior changes.
config/​grid.yaml Registers the shared context service.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

The interactive grid keeps its default-language fallback. Adds a regression
test wiring a real AdapterResolver, plus flag-restore tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fashxp fashxp added this to the 2026.3.1 milestone Oct 6, 2026
@sonarqubecloud

sonarqubecloud Bot commented Oct 6, 2026

Copy link
Copy Markdown

@jcPimcore jcPimcore modified the milestones: 2026.3.1, 2026.3.2 Oct 6, 2026
@fashxp fashxp self-assigned this Oct 6, 2026
@fashxp fashxp added the Bug label Oct 6, 2026
@fashxp
fashxp merged commit 5f2bfc8 into 2026.3 Oct 6, 2026
34 of 37 checks passed
@fashxp
fashxp deleted the fix/advanced-column-source-field-locale branch October 6, 2026 15:53
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants