FIX Report create-folder errors instead of failing silently - #1691
Open
edwilde wants to merge 1 commit into
Open
FIX Report create-folder errors instead of failing silently#1691edwilde wants to merge 1 commit into
edwilde wants to merge 1 commit into
Conversation
AssetAdmin::createfolder() threw an InvalidArgumentException when the parent folder was missing or the permission check denied creation. The client could not interpret that, so the Create button reverted to its label with no message. Return structured HTTP errors instead: 404 "Folder not found" when the parent is gone, and 403 "You do not have permission to create a folder" when Folder::canCreate() denies, and surface the returned message as a toast.
2 tasks
edwilde
marked this pull request as ready for review
July 20, 2026 21:17
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.
Description
Creating a folder could fail silently. The Create button showed its loading state, then reverted to "Create" with no error. This happens when the current user cannot create in the target folder, for example a protected parent whose children inherit permissions after a CMS 5 to 6 upgrade.
AssetAdmin::createfolder()threw anInvalidArgumentExceptionfor both the "parent not found" and "permission denied" cases. The client had no structured error to display, so the failure was swallowed.Change
createfolder():404withFOLDER_NOT_FOUND("Folder not found") when the parent folder cannot be found.403withCreateFolderPermissionDenied("You do not have permission to create a folder") whenFolder::canCreate()denies.CreatePermissionDeniedpattern.This makes the "no error message" behaviour visible to the user. It does not change why permission is denied. The underlying permission-inheritance cause is being addressed separately.
Related
Addresses the missing-error-message aspect of #1689. The underlying permission-inheritance denial is tracked separately, so this does not close the issue.
Tests
AssetAdminTestcovers the 403 and 404 responses.AssetAdmin-test.jscovers the error toast.