Skip to content

[Bug] Include key ID and exception message in classification store field definition warning#468

Open
jcPimcore wants to merge 4 commits into
2.5from
190-generic-data-index-bundle
Open

[Bug] Include key ID and exception message in classification store field definition warning#468
jcPimcore wants to merge 4 commits into
2.5from
190-generic-data-index-bundle

Conversation

@jcPimcore

@jcPimcore jcPimcore commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Resolves: pimcore/platform-version#190

Summary

  • The warning logged when a classification store key's field definition could not be resolved (ClassificationStoreAdapter::getFieldDefinitionForKey) omitted the key ID and swallowed the original exception message, making the warning impossible to act on.
  • Reported in Fix index creation for new class definitions #190 — after upgrading, generic-data-index:update:index -r produced many warnings like Could not get field definition for type input in group 9 with no way to identify which key was affected or why.
  • Now logs the key ID and the caught exception's message alongside the type/group, so the specific broken/legacy classification key can be identified and fixed.

Test plan

  • Existing unit tests in tests/Unit/SearchIndexAdapter/DataObject/FieldDefinitionAdapter/ClassificationStoreAdapterTest.php pass
  • Manually trigger a classification store key with a broken/unresolvable field definition and confirm the warning now includes key ID and exception message

…eld definition warning

The warning logged when a classification store key's field definition
could not be resolved omitted the key ID and swallowed the original
exception message, making it impossible to identify which key was
affected or why.
@jcPimcore
jcPimcore requested a review from Copilot July 16, 2026 13:15
@jcPimcore jcPimcore self-assigned this Jul 16, 2026
@jcPimcore jcPimcore added the Bug label Jul 16, 2026
@jcPimcore jcPimcore added this to the 2.5.6 milestone Jul 16, 2026

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.

Pull request overview

Improves classification-store diagnostics when field definitions cannot be resolved.

Changes:

  • Adds the affected key ID to warnings.
  • Preserves the caught exception message.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…warning

Covers the diagnostic behavior introduced in 8d8c257: when
getFieldDefinitionFromKeyConfig() throws, the logged warning must
include the key type, key ID, group ID, and the original exception
message.

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.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Substring assertions were weak: 'input' also appears inside the
exception text, and bare numeric checks for 42/9 didn't verify they
were logged as the key ID and group ID specifically. Asserting the
full expected message ensures a regression that drops or mislabels
any field fails the test.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Copilot AI review requested due to automatic review settings July 16, 2026 14:21

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.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Matches the style already used by the other warning in this class
(getNormalizedValue) and avoids spacing/concatenation mistakes if the
message is changed again.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Copilot AI review requested due to automatic review settings July 16, 2026 14:30
@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.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants