-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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.4] MediaManager: improve error handling #38536
base: 4.4-dev
Are you sure you want to change the base?
Conversation
Nice one as it will catch on every request the error messages. |
Thank you for providing a better solution! |
even better would be to display the error message from the svgsanitizer which explains exactly why the file was rejected |
I have added documentation about uploading SVG files. You can find it at https://docs.joomla.org/J4.x:Media:_Uploading_SVG_files. It may need refining and additional content. You are welcome to pitch in, thank you! |
The script render all messages that was sent from PHP backend. |
I have tested this item ✅ successfully on b5feda2 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/38536. |
Before the fix, the script was rendered only first message, and rest were ignored. |
The first message is from the Exception https://github.com/joomla/joomla-cms/blob/4.2-dev/plugins/filesystem/local/src/Adapter/LocalAdapter.php#L772 , additional messages are Joomla system messages generated by calling $app->enqueueMessage from Still the first error message is redundant as Brian said. Is it OK to make the Exception https://github.com/joomla/joomla-cms/blob/4.2-dev/plugins/filesystem/local/src/Adapter/LocalAdapter.php#L772 with empty message, and have the Joomla system messages rendered for this case ? It is kind of workaround but more user friendly. |
I do not think. |
I have tested this item ✅ successfully on b5feda2 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/38536. |
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/38536. |
For Header logo fixer: J4 dashboard > Content > Media > Create a new Folder "svgs" Topright "Options" in the Media SAVE J4 dashboard > System > Templates > Site Template Styles > Cassiopeia - Default > /images/svgs/header-logo.svg Tagline (this is a must-step): SAVE I will update once i have a fixer for the Footer svg file ;-) |
@AmyKrizanWang please do not update your comment. It is nothing to do with this issue. |
This pull request has been automatically rebased to 4.3-dev. |
Conflicts: administrator/components/com_media/resources/scripts/app/Api.es6.js
Pleas test it again, there was a complex conflict, I had to redo changes. |
This pull request has been automatically rebased to 4.4-dev. |
Pull Request for Issue #38068 and #38530 .
Summary of Changes
Improve error handling in MediaManager
Testing Instructions
Apply patch. Run
npm install
.Try upload something not allowed in to mediamanager.
Actual result BEFORE applying this Pull Request
General error
Unable to upload file.
Expected result AFTER applying this Pull Request
General error
Unable to upload file.
Then multiple detailed errors:
Or
Illegal mime type detected
orThis file type is not supported
(depend from medimanager config)Or for svg:
The file looks suspicious, therefore cannot be uploaded
Documentation Changes Required
nope
@brianteeman please review an updated string.