Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.x]: Inconsistant user experience / interface for asset related errors #13024

Closed
WilliamIsted opened this issue Mar 31, 2023 · 2 comments
Closed
Assignees

Comments

@WilliamIsted
Copy link

WilliamIsted commented Mar 31, 2023

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."

Screenshot 2023-03-31 at 23 38 35

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.

Screenshot 2023-03-31 at 23 40 50

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.

Screenshot 2023-03-31 at 23 42 02

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)
@brandonkelly
Copy link
Member

Thanks for the nudge. All alert() calls have now been replaced with error notifications, for the next Craft 3 and 4 releases.

@brandonkelly
Copy link
Member

Craft 3.8.6 and 4.4.6 are out with that change 🎉

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

No branches or pull requests

2 participants