Skip to content

Fix Image add Content tab crash and the form close control. - #164

Open
aryan7081 wants to merge 4 commits into
plone:mainfrom
aryan7081:fix-image-content-tab-widget
Open

Fix Image add Content tab crash and the form close control.#164
aryan7081 wants to merge 4 commits into
plone:mainfrom
aryan7081:fix-image-content-tab-widget

Conversation

@aryan7081

Copy link
Copy Markdown
Contributor

Fixes #163

This issue happened because the Image add Content tab spread the full JSON Schema onto React Aria widgets, so object fields crashed the route. The image object browser then fetched /@objectBrowserWidget/@@add, which is a CMS route rather than a content path, so React Router had no result for that resource. Close did nothing on add because it linked to content['@id'], which a new item does not have yet. Save then failed because the Image field stored a URL string while createContent expects a NamedBlobImage object (data, encoding, content-type, filename).

This fix registers ImageWidget for REST API Image and file fields, forwards only a small set of widget props, maps /@@add and /@@edit to a real content path before loading the object browser, and points Close at that path (or the item @id on edit). Uploads write a NamedBlobImage payload; picking an existing image copies that file into the same shape so Save can succeed. Image scale flattening also skips missing scales/download so blob images do not take down the view.

Caution

The Volto Team has suspended its review of new pull requests from first-time contributors until the release of Plone 7, which is preliminarily scheduled for the second quarter of 2026.
Read details.



If your pull request closes an open issue, include the exact text below, immediately followed by the issue number. When your pull request gets merged, then that issue will close automatically.

Closes #

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Image Content tab crashes because the image field is rendered as a TextField

1 participant