fix(edit-content): resolve the Binary field variable for the image editor (#36426)#36427
Closed
oidacra wants to merge 1 commit into
Closed
fix(edit-content): resolve the Binary field variable for the image editor (#36426)#36427oidacra wants to merge 1 commit into
oidacra wants to merge 1 commit into
Conversation
…itor Opening the image editor from a Binary field hydrated from a saved contentlet built the editor URLs with the parent contentlet's titleImage, which can point at an Image reference field that holds no binary. The editor preview then 404s and a save from that state stages a temp file with unusable metadata, degrading the field preview to the type icon. Prefer the field variable the store injects when hydrating from the parent contentlet (setFileFromContentlet); standalone assets (dotAsset via getAssetData, AI-generated images) carry no injected fieldVariable and keep resolving through their own titleImage. Refs: #36426
Contributor
Contributor
🤖 dotBot Review (Bedrock)Reviewed 2 file(s); 0 candidate(s) → 0 confirmed, 0 uncertain (unverified, kept for review). ✅ No issues found after verification. us.deepseek.r1-v1:0 · Run: #28681746629 · tokens: in: 4063 · out: 1141 · total: 5204 · calls: 2 · est. ~$0.012 |
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.
Proposed Changes
DotFileFieldComponent.onEditImage()resolving the wrong field variable for Binary fields hydrated from a saved contentlet: it used the parent contentlet'stitleImage, which can point at an Image reference field with no binary, so the editor preview requested/contentAsset/image/{parentInode}/{titleImage}/...and got a 404 ("We couldn't render the preview"). Saving from that state staged a temp file with unusable metadata and the field preview degraded to the type icon.fieldVariablewhen hydrating from the parent (setFileFromContentlet); prefer it, falling back totitleImageonly for standalone assets (dotAsset viagetAssetData, AI-generated images), which carry no injected variable and do keep their image in their owntitleImagefield.titleImage).Pre-existing on main (editor wiring from #36172 / #36350); surfaced while QA-testing #36295. Verified live: Binary editor preview renders and the save round-trip applies the edit; Image/File fields are unaffected. Related: #36406 reworks the Image/File editor flow but leaves Binary behavior unchanged, so both changes are independent.
This PR fixes: #36426