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

Resolve A "500 (Internal Server Error)" appears in Developer Console if Delete the image that is added to Page Content issue25893 #25924

Conversation

edenduong
Copy link
Contributor

Description (*)

  1. A "500 (Internal Server Error)" appears in Developer Console if Delete the image that is added to Page Content #25893: A "500 (Internal Server Error)" appears in Developer Console if Delete the image that is added to Page Content

Fixed Issues (if relevant)

  1. A "500 (Internal Server Error)" appears in Developer Console if Delete the image that is added to Page Content #25893: A "500 (Internal Server Error)" appears in Developer Console if Delete the image that is added to Page Content

Manual testing scenarios (*)

  1. From Magento Admin go to Content - Pages, click Add New Page
  2. Expand Content, click Show/Hide Editor, click Insert Image
  3. Click Chose file and browse for any image file from your computer, Open
  4. In Insert File... window select the previously opened image file and click Add Selected
  5. From Content click Insert Image again. Select the previously added image and Delete Selected
  6. Close the Insert File... window (X)
  7. Open the Developer Console in your web browser (F12 key)
  8. Click Show/Hide Editor

Expected result

No error appears in Developer Console

Questions or comments

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds are green)

@m2-assistant
Copy link

m2-assistant bot commented Dec 6, 2019

Hi @edenduong. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.4-develop instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Guide documentation.

@m2-assistant
Copy link

m2-assistant bot commented Dec 6, 2019

Hi @edenduong, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

Copy link
Contributor

@dmytro-ch dmytro-ch left a 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);
Copy link
Contributor

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.

@dmytro-ch dmytro-ch added Auto-Tests: Covered All changes in Pull Request is covered by auto-tests Award: bug fix Award: test coverage labels Dec 10, 2019
@edenduong
Copy link
Contributor Author

@magento give me 2.4-develop instance

@magento-engcom-team
Copy link
Contributor

Hi @edenduong. Thank you for your request. I'm working on Magento 2.4-develop instance for you

@magento-engcom-team
Copy link
Contributor

Hi @edenduong, here is your Magento instance.
Admin access: https://i-25924-2-4-develop.instances.magento-community.engineering/admin
Login: admin Password: 123123q
Instance will be terminated in up to 3 hours.

@edenduong
Copy link
Contributor Author

@magento give me test instance

@magento-engcom-team
Copy link
Contributor

Hi @edenduong. Thank you for your request. I'm working on Magento instance for you

@magento-engcom-team
Copy link
Contributor

Hi @edenduong, here is your new Magento instance.
Admin access: https://pr-25924.instances.magento-community.engineering/admin
Login: admin Password: 123123q

@magento-engcom-team
Copy link
Contributor

Hi @dmytro-ch, thank you for the review.
ENGCOM-6442 has been created to process this Pull Request

@engcom-Alfa engcom-Alfa self-assigned this Dec 11, 2019
@engcom-Alfa
Copy link
Contributor

✔️ QA Passed

@m2-assistant
Copy link

m2-assistant bot commented Dec 12, 2019

Hi @edenduong, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

@sdzhepa sdzhepa mentioned this pull request May 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants