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

Magento 2.2.X - WYSIWYG editor, insert image directive not replaced by actual image URL #12741

Closed
dverkade opened this issue Dec 15, 2017 · 2 comments
Labels
Fixed in 2.2.x The issue has been fixed in 2.2 release line Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed

Comments

@dverkade
Copy link
Member

dverkade commented Dec 15, 2017

When the users adds an image in the WYSIWYG editor with the "Insert Image" option a URL is generated by Magento with a directive in it. This directive should be replaced when saving the page so that the directive URL is replaced by the correct media URL in Magento. Currently this does not happen and on the frontend the Directive URL is shown. This will result in broken images on the frontend.

Preconditions

  1. Checked on Magento version 2.1.X, 2.2.0 and 2.2.1

Relations

Relates to:
#7167 2.2.0-dev - cms images are being added as __directive for path

Pull requests already fixing this issue, but closed without merging:
#12467 WYSIWYG JS - Directive URL not always properly detected

Steps to reproduce

  1. Create a new CMS page in the backend of Magento
  2. Open the WYSIWYG editor and use the "Insert Image" option in the toolbar to insert an image. (See screenshot below).
  3. Save the page.
  4. The admin user needs to logout of the backoffice.
  5. Go to the CMS page on the frontend of Magento. The inserted image will be broken, when inspecting the HTML you will see that the image URL will be something like: "domain.com/admin/cms/wysiwyg/directive/___directive/e3ttZWRpYSB1cmw9Ind5c2l3eWcvQmxvZ19JbWczLnBuZyJ9fQ%2C%2C/key/4f92067f70cff318e8618a7e322e964261df0edae0581197d92cd51a93ba198d/"

image
To reproduce, use this dialog in order to insert the image into the editor.

Expected result

  1. When switching with the "Show / Hide editor option" the directive URL should be replaced with the correct image URL.
  2. The URL needs to be replaced by the correct name of the image. So that on the frontend the correct image will be loaded.

image
image

Actual result

  1. The long directive URL is not replaced and is shown on the frontend resulting in broken images.

image
image

@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Dec 15, 2017
@magento-engcom-team magento-engcom-team added the Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed label Dec 15, 2017
@magento-engcom-team
Copy link
Contributor

@dverkade, thank you for your report.
The issue is already fixed in 2.2.2

@magento-engcom-team magento-engcom-team added Fixed in 2.2.x The issue has been fixed in 2.2 release line Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed labels Dec 15, 2017
@dverkade
Copy link
Member Author

Hi @magento-engcom-team,

Thank you for your reply. We have tested this on Magento 2.2.2 on this works correct now. Please note that I could not find that this issue was resolved in the Magento 2.2.2 release notes. Searched for "directive" and "wysiwyg" and both did not mention resolving this issue.

Please also close this issue #7167 which is the same issue and is resolved in Magento 2.2.2 now. So this can be closed as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fixed in 2.2.x The issue has been fixed in 2.2 release line Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed
Projects
None yet
Development

No branches or pull requests

2 participants