-
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
Resolve A "500 (Internal Server Error)" appears in Developer Console if Delete the image that is added to Page Content issue25893 #25924
Conversation
…if Delete the image that is added to Page Content issue25893
Hi @edenduong. Thank you for your contribution
For more details, please, review the Magento Contributor Guide documentation. |
Hi @edenduong, thank you for your contribution! |
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 @edenduong , thank you for your contribution!
Could you please refactor the legacy approaches already used in this class?
We should avoid the direct object manager usage, so the following dependencies should be initialized in the constructor method:
\Magento\Framework\Image\AdapterFactory
Magento\Cms\Model\Wysiwyg\Config
\Psr\Log\LoggerInterface
$resultRaw->setContents($image->getImage()); | ||
$this->_objectManager->get(\Psr\Log\LoggerInterface::class)->critical($e); | ||
} catch (\Exception $e) { | ||
$this->_objectManager->get(\Psr\Log\LoggerInterface::class)->critical($e); |
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.
I guess the expected errors should be treated with "error" or even "warning" severity instead of "critical" in both cases.
Those errors are usually thrown because of the unsupported image format or missing file etc.
@magento give me 2.4-develop instance |
Hi @edenduong. Thank you for your request. I'm working on Magento 2.4-develop instance for you |
Hi @edenduong, here is your Magento instance. |
@magento give me test instance |
Hi @edenduong. Thank you for your request. I'm working on Magento instance for you |
Hi @edenduong, here is your new Magento instance. |
Hi @dmytro-ch, thank you for the review. |
✔️ QA Passed |
…oper Console if Delete the image that is added to Page Content issue25893 #25924
Hi @edenduong, thank you for your contribution! |
Description (*)
Fixed Issues (if relevant)
Manual testing scenarios (*)
Expected result
No error appears in Developer Console
Questions or comments
Contribution checklist (*)