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
When using the assets control panel interface the user is given feedback by notifications appearing in the bottom left of the page. However, some actions which are prevented from completing by a returning error within the XHR causes a window alert to show instead.
Steps to reproduce
Scenario A:
1. For example: Set user permissions to disallow "Delete assets" to a volume.
2. Upload a file to that volume within the control panel assets page.
3. Upload the same file to that volume clicking "Cancel" when prompted that the file already exists.
4. Receive window alert stating "User is not authorized to perform this action."
5. Set user permissions to disallow "Save assets".
6. Upload a file to that volume within the control panel assets page.
8. Receive window alert stating "User is not authorized to perform this action."
Scenario B:
1. Use business logic or other installed plugin (i.e. Remote Asset Protect) to prevent assets being created or moved by listening to Asset::EVENT_BEFORE_SAVE.
2. Set isValid to false and throw Exception to return a message.
3. Receive window alert stating error message thrown.
Expected behavior
Scenario A and B should use the same notification UI as Scenario C and general success notifications.
Actual behavior
Scenario C:
1. Use business logic or other installed plugin (i.e. Remote Asset Protect) to prevent assets being created or moved by listening to Asset::EVENT_BEFORE_DELETE.
2. Set isValid to false and throw Exception to return a message.
3. Receive expected notification in bottom left of page with the error message thrown.
Craft CMS version
4.4.5
PHP version
8.1.13
Operating system and version
No response
Database type and version
No response
Image driver and version
No response
Installed plugins and versions
Remote Asset Protect (2.0.2)
The text was updated successfully, but these errors were encountered:
What happened?
Description
When using the assets control panel interface the user is given feedback by notifications appearing in the bottom left of the page. However, some actions which are prevented from completing by a returning error within the XHR causes a window alert to show instead.
Steps to reproduce
Scenario A:
1. For example: Set user permissions to disallow "Delete assets" to a volume.
2. Upload a file to that volume within the control panel assets page.
3. Upload the same file to that volume clicking "Cancel" when prompted that the file already exists.
4. Receive window alert stating "User is not authorized to perform this action."
5. Set user permissions to disallow "Save assets".
6. Upload a file to that volume within the control panel assets page.
8. Receive window alert stating "User is not authorized to perform this action."
Scenario B:
1. Use business logic or other installed plugin (i.e. Remote Asset Protect) to prevent assets being created or moved by listening to
Asset::EVENT_BEFORE_SAVE
.2. Set
isValid
to false and throwException
to return a message.3. Receive window alert stating error message thrown.
Expected behavior
Scenario A and B should use the same notification UI as Scenario C and general success notifications.
Actual behavior
Scenario C:
1. Use business logic or other installed plugin (i.e. Remote Asset Protect) to prevent assets being created or moved by listening to
Asset::EVENT_BEFORE_DELETE
.2. Set
isValid
to false and throwException
to return a message.3. Receive expected notification in bottom left of page with the error message thrown.
Craft CMS version
4.4.5
PHP version
8.1.13
Operating system and version
No response
Database type and version
No response
Image driver and version
No response
Installed plugins and versions
The text was updated successfully, but these errors were encountered: