fix: resolve criteria association warnings for blog author and suggest media#84
Merged
lacknere merged 1 commit intoMay 4, 2026
Conversation
…t media Two `addAssociation()` calls reference associations that don't exist on their target entities, producing Symfony WARNINGs in shop logs on every suggest request and blog detail load. Changes (Option A from issue Werkstattl#83): - BlogPageLoader::loadBlogEntry(): rename `author.salutation` to `blogAuthor.salutation` and drop the now-redundant standalone `blogAuthor` association. The correct association on BlogEntryDefinition is `blogAuthor` (author_id FK); `author` is a legacy alias that no longer resolves. - ProductSuggestDecorated::getBlogs(): remove `addAssociation('media')`. Since the teaser image became translatable, `media_id` lives on BlogEntryTranslationDefinition as a FkField; the hydrated media is now provided by `BlogSubscriber::onBlogEntryLoaded`, so the criteria-level association is both unresolvable and redundant. Refs: Werkstattl#83
Collaborator
|
Thanks for your contribution 🎉 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes the warning spam reported in #83 by applying Option A (minimal, no behavior change), as agreed with @lacknere.
Two
addAssociation()calls reference associations that don't exist on their target entities, producing SymfonyWARNINGlog entries on every search-suggest request and blog detail load. Data still loads correctly viaBlogSubscriber::onBlogEntryLoaded, so this is purely a log-noise fix.Changes
src/Page/Blog/BlogPageLoader.phpaddAssociation('author.salutation')→addAssociation('blogAuthor.salutation')addAssociation('blogAuthor')BlogEntryDefinitionexposes the relation asblogAuthor(FKauthor_id);authoris a legacy alias that no longer resolves.src/Content/SalesChannel/Suggest/ProductSuggestDecorated.phpaddAssociation('media')Since the teaser image became translatable,
media_idlives onBlogEntryTranslationDefinitionas anFkFieldonly —AssociationFields are not supported onEntityTranslationDefinitions (per @lacknere's clarification on #83). The hydrated media is now provided byBlogSubscriber::onBlogEntryLoaded, so the criteria-level association is both unresolvable and redundant.Impact observed in production logs
On a shop running 5.1.3 with regular search-suggest traffic:
~174warnings/day from the suggest route~18warnings/day from blog detail loadsBoth go to zero with this change. Frontend behavior unchanged.
Test plan
/suggestrequest with active search-box config: blog tile renders with image, noWARNINGinvar/log/*.logWARNINGinvar/log/*.logRefs: #83
🤖 Generated with Claude Code