[5.x] Avoid eager loading asset move folders#14694
Draft
el-schneider wants to merge 1 commit into
Draft
Conversation
duncanmcclean
requested changes
May 20, 2026
Member
There was a problem hiding this comment.
We're only releasing security fixes for v5 now. Please target 6.x.
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
Fix asset browser move actions so destination folders are no longer serialized into every asset/folder action payload, as it renders our current setup with ~1000 folders basically unusable, due to ginormous payloads.
Previously,
MoveAssetandMoveAssetFolderbuilt a plainselectfield with every folder in the container as inlineoptions. In large containers, the browser payload scaled with:This PR reuses Statamic's existing
asset_folderrelationship field instead. The move actions now return a small field config:type: asset_foldercontainer: <current container>mode: selectmax_items: 1The initial asset browser payload stays small, and destination folders are loaded only when the Move modal opens.
Why reuse
asset_folder?Statamic already has a fieldtype for selecting folders from an asset container. It is relationship-backed and already loads selectable items through the relationship endpoint.
Reusing it avoids a new action-specific endpoint or custom UI while keeping the old dropdown-style UX.
max_items: 1also preserves the existing action value shape because the relationship field processes the selection back to a single folder path string.Implementation notes
MoveAssetandMoveAssetFolderno longer call:inside
fieldItems().AssetFolderFieldtype.vuenow passes action config likecontainerandmodethrough to the underlying relationship field. It also supports action modal usage where there is no publishstoreName, by reading the container directly from field config.Performance impact
Before:
Blink::once()avoided repeated PHP computation, but not repeated JSON serializationAfter: