[5.2] MediaManager: improve error handling#38536
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. |
|
@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
|
This pull request has been automatically rebased to 4.4-dev. |
comment removed |
|
This pull request has been automatically rebased to 5.2-dev. |
|
I have tested this item ✅ successfully on 2e13c16 Before PRAfter PR (and recompiling with
|
|
I have tested this item ✅ successfully on 8b01df6 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. |
|
Thank you! |
joomla/joomla-cms#44658 + joomla/joomla-cms#44712 - (только для др. пакетов) joomla/joomla-cms#39878 + joomla/joomla-cms#38536 + joomla/joomla-cms#36719 + joomla/joomla-cms#44753 + joomla/joomla-cms#44709 + joomla/joomla-cms#44793 - (только для en-GB)



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 detectedorThis file type is not supported(depend from medimanager config)Or for svg:
The file looks suspicious, therefore cannot be uploadedDocumentation Changes Required
nope
@brianteeman please review an updated string.