-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
In System/Export controlers use MessageManager instead of throwing exceptions #26746
In System/Export controlers use MessageManager instead of throwing exceptions #26746
Conversation
Hi @pmarki. Thank you for your contribution
For more details, please, review the Magento Contributor Guide documentation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @pmarki, thank you for your contribution.
Could you please review the comments below related to the backslash and answer the question?
Also, please provide the translations for new texts into i81n/en_US.csv
.
Additionally, based on Magento Definition of Done all the changes have to be to covered by automated tests.
Thank you.
app/code/Magento/ImportExport/Controller/Adminhtml/Export/File/Delete.php
Outdated
Show resolved
Hide resolved
app/code/Magento/ImportExport/Controller/Adminhtml/Export/File/Delete.php
Outdated
Show resolved
Hide resolved
app/code/Magento/ImportExport/Controller/Adminhtml/Export/File/Delete.php
Outdated
Show resolved
Hide resolved
app/code/Magento/ImportExport/Controller/Adminhtml/Export/File/Download.php
Outdated
Show resolved
Hide resolved
app/code/Magento/ImportExport/Controller/Adminhtml/Export/File/Download.php
Outdated
Show resolved
Hide resolved
app/code/Magento/ImportExport/Controller/Adminhtml/Export/File/Download.php
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @pmarki, thank you for the test coverage, here are couple of suggestions, could you please adjust the tests based on them?
Please do the same for the other test.
Please check the failing static tests as well.
Thank you.
app/code/Magento/ImportExport/Test/Unit/Controller/Adminhtml/Export/File/DeleteTest.php
Outdated
Show resolved
Hide resolved
app/code/Magento/ImportExport/Test/Unit/Controller/Adminhtml/Export/File/DeleteTest.php
Outdated
Show resolved
Hide resolved
app/code/Magento/ImportExport/Test/Unit/Controller/Adminhtml/Export/File/DeleteTest.php
Show resolved
Hide resolved
app/code/Magento/ImportExport/Test/Unit/Controller/Adminhtml/Export/File/DeleteTest.php
Outdated
Show resolved
Hide resolved
app/code/Magento/ImportExport/Test/Unit/Controller/Adminhtml/Export/File/DeleteTest.php
Show resolved
Hide resolved
Hi @pmarki, thank you for the test adjustments, could you please check the failing Static Tests and fix them? |
hi @eduard13 Static tests fixed. I checked other failed tests and looks like it is not related to my changes. Let me know if anything else can be improved and thank you for your patience, I'm doing PR for Magento first time, plenty of things to check :) |
@magento run all tests |
Hi @pmarki, awesome 🎉. You're welcome, and thank you for all the fixes. The failing functional tests indeed aren't related with the existing changes, but let's wait them to finish running. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The failing tests aren't related to these changes.
Hi @eduard13, thank you for the review. |
✔️ QA passed |
@magento run all tests |
Failed functional tests not related to the changes in this PR |
…f throwing exceptions #26746
Hi @pmarki, thank you for your contribution! |
Description (*)
Currently when you try to download or delete a file from Magento admin in System/Export section if the file is corrupted or was already deleted both controllers will throw exceptions that won't be caught. This will result in internal server error. I have refactor ImportExport\Controller\Adminhtml\Export\File\Delete and ImportExport\Controller\Adminhtml\Export\File\Download controllers. They will use messageManager instead of throwing errors. This means admin user will see proper success/error messages as in other admin areas.
Related Pull Requests
NA
Fixed Issues (if relevant)
NA
Manual testing scenarios (*)
Testing can be done with SSH access to file system: File to download\delete can be made corrupted, ready only, no access to apache user, new folder can be created in var/export, etc.
Questions or comments
The section with files to download shouldn't list folders. I'll try to fix this in a separate PR.
Contribution checklist (*)