You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
files field with returnFormat id: a string value in a repeater row crashes the block in the editor #117
A files field with "returnFormat": "id" crashes the block in the editor when the stored value is a string rather than a number or an array. The block shows "This block has encountered an error and cannot be previewed." The front end renders correctly, because the template receives the stored value as documented.
We reference images by a stable name rather than an attachment ID, so that a page file is portable between a staging site and production (IDs differ). The page file sets "image": "buckshair-home"; a filter resolves the name to the attachment on render. With returnFormat: "id" the template receives the string exactly as stored, which is what we need, and the front end is right.
What happens
Opening a page that holds such a block in the editor throws, once per block instance:
TypeError: (intermediate value)(intermediate value)(intermediate value).map is not a function
at .../blockstudio/includes/admin/assets/blocks/index.tsx.js?ver=6dcbff0c7d82e20929e3:1:1035157
and the block falls back to the error boundary. A multiple files field at the top level of the block holding an array of the same strings ("shots": ["a", "b", "c"]) does not throw: it shows cards with no thumbnail, which is fine. The single field in the repeater row holds the bare string, and the field component calls .map on it.
Suggested behaviour
The field component treats a non-array value as a one-item list (as it already does for a bare attachment ID), and a value it cannot resolve to media as a card with no thumbnail, as the multiple case does. Then a page file can hold a name in a single files field without the editor losing the block preview.
Workaround
Store the single image as a one-item array in the page file, if the field accepts that shape; we are measuring that now. Rewriting every page file for an editor-only shape is the per-project version of the fix above.
Fixed and released in Blockstudio 7.7.2, in e8356b83. Single files fields, including repeater rows, now display stored string references as fallback cards without rewriting their values. Removing and reordering cards preserves the other entries. The full CI run passed, including the new editor save/reload and media-selection regression tests.
Tested on 7.7.2 against our pages on staging this morning: the editor opens clean on every page that names an image in a single files field, and the cards show the name without a thumbnail as you described. No change to what is saved, which is what we needed for the page files to stay portable. Thank you for the fast turnaround on this one too.
Activity
Preserve portable file references in editor cards [all]
dnnsjsk commentedon Oct 15, 2026
Fixed and released in Blockstudio 7.7.2, in e8356b83. Single files fields, including repeater rows, now display stored string references as fallback cards without rewriting their values. Removing and reordering cards preserves the other entries. The full CI run passed, including the new editor save/reload and media-selection regression tests.
WebUppAdmin commentedon Oct 16, 2026
Tested on 7.7.2 against our pages on staging this morning: the editor opens clean on every page that names an image in a single files field, and the cards show the name without a thumbnail as you described. No change to what is saved, which is what we needed for the page files to stay portable. Thank you for the fast turnaround on this one too.