Skip to content

Expose the key title in the Classification Store layout API - #2159

Merged
lukmzig merged 1 commit into
cs-store-improvementsfrom
1648-expose-the-key-title-in-the-classification-store-layout-api
Oct 27, 2026
Merged

lukmzig merged 1 commit into
cs-store-improvementsfrom
1648-expose-the-key-title-in-the-classification-store-layout-api

Conversation

@lukmzig

@lukmzig lukmzig commented Oct 27, 2026

Copy link
Copy Markdown
Contributor
  • Adds an optional, nullable title to KeyLayout, returned by the layout-by-key, layout-by-group and layout-by-collection endpoints.
  • The value is the key configuration's title column, not the title inside definition. The two can differ after a rename through the configuration API.
  • The title is returned raw. It may be a translation key, null stays null and '' stays '', and clients must fall back to name themselves.
  • It is read through KeyConfigResolverInterface because the core relation has no title, so group and collection layouts do one cached lookup per key.

Resolves pimcore/product-management#1648

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@lukmzig lukmzig self-assigned this Oct 27, 2026
@lukmzig
lukmzig requested a balanced review from Copilot October 27, 2026 07:45
@sonarqubecloud

Copy link
Copy Markdown

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.

🔵 Needs a closer look

Dependency-backed title resolution and serialized API responses remain unverified, so final maintainer validation is needed despite no confirmed defects.

No open issues 🎉

What changed in this PR

Verdict: Request review — runtime integration remains unverified.

This PR exposes the stored Classification Store key title in Studio’s key, group, and collection layout responses, allowing clients to choose their display labels.

Changes:

  • Adds an optional, nullable title to KeyLayout, preserving existing constructor calls (src/ClassificationStore/Schema/KeyLayout.php:45–46).
  • Retrieves titles through the key configuration resolver in the service layer, addressing the missing response value without relying on the field definition’s title (src/ClassificationStore/Service/KeyGroupLayoutService.php:102–111). Group layouts use the same lookup (src/ClassificationStore/Service/GroupService.php:134).
  • Adds schema and service regression tests and documents raw-title semantics, translation responsibility, and client fallback (doc/02_Installation_and_Configuration/05_Upgrade.md:6–10).

Coverage and compatibility: The tests cover key retrieval, group propagation, collection propagation, and the optional schema argument. They check stored strings, nulls, and empty strings. The response field is additive; dependency-backed resolver behavior, service wiring, and serialized endpoint responses remain unverified. Tests were not executed during this review.

File Description
tests/​Unit/​ClassificationStore/​Service/​KeyGroupLayoutServiceTest.php Tests verbatim stored titles, nulls, and empty strings.
tests/​Unit/​ClassificationStore/​Service/​GroupServiceTest.php Tests title propagation to group keys.
tests/​Unit/​ClassificationStore/​Service/​CollectionServiceTest.php Tests preservation of titles across collection groups.
tests/​Unit/​ClassificationStore/​Schema/​KeyLayoutTest.php Tests the optional title argument and unchanged required fields.
src/​ClassificationStore/​Service/​KeyGroupLayoutServiceInterface.php Declares the stored-title lookup contract.
src/​ClassificationStore/​Service/​KeyGroupLayoutService.php Resolves stored titles and populates key layouts.
src/​ClassificationStore/​Service/​GroupService.php Populates group key titles and injects the object resolver interface.
src/​ClassificationStore/​Schema/​KeyLayout.php Adds the nullable title property, OpenAPI metadata, and getter.
doc/​02_Installation_and_Configuration/​05_Upgrade.md Documents title behavior across all three endpoints.

Review effort: Balanced

@lukmzig
lukmzig marked this pull request as ready for review October 27, 2026 07:53
@lukmzig lukmzig added this to the 2026.4.0 milestone Oct 27, 2026
@lukmzig
lukmzig merged commit e7104dc into cs-store-improvements Oct 27, 2026
25 of 27 checks passed
@lukmzig
lukmzig deleted the 1648-expose-the-key-title-in-the-classification-store-layout-api branch October 27, 2026 08:03
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 27, 2026
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