Magento2: Media URLs broken when adding/editing the image by editor

Created on 10 Nov 2017  路  9Comments  路  Source: magento/magento2

When we add/edit an image in the CMS Page/Block through editor the media URLs are changed to something like this -

admin/cms/wysiwyg/directive/___directive/e3ttZWRpYSB1cmw9Ind5c2l3eWcvcHJvbW9fYmFubmVyMi5wbmcifX0%2C/key/fc2df2446d1ffe0c12fbe8fd3775348a9206ad9ba6b04751ba4cf64ab24fcba6/

Preconditions

  1. Magento 2.1.7/2.1.9/2.2.0
  2. PHP 5.6/7
  3. XAMPP Windows / CentOS 7

Steps to reproduce

  1. Go to CMS Page/Static Block which have any image in the content
  2. Turn on Editor by clicking on Show / Hide Editor
  3. Click on the Image Thumbnail and Click on the Insert/Edit Image Icon in editor tools panel
  4. Choose any other image or the same image from library and click on update

Expected result

  1. The Image URL should be like

Actual result

  1. The Image URL changes to - http://www.example.com/admin/cms/wysiwyg/directive/___directive/e3ttZWRpYSB1cmw9Ind5c2l3eWcvcHJvbW9fYmFubmVyMi5wbmcifX0%2C/key/fc2df2446d1ffe0c12fbe8fd3775348a9206ad9ba6b04751ba4cf64ab24fcba6/

P.S.: It works perfect when we insert an image after hiding the editor using the insert image button in no editor mode

Cannot Reproduce Clear Description Format is valid

All 9 comments

@dinkeronline, thank you for your report.
We were not able to reproduce this issue by following the steps you provided. If you'd like to update it, please reopen the issue.
We tested the issue on 2.3.0-dev, 2.1.10, 2.2.1

@magento-engcom-team See below screenshots -
Step 1- Enabled Editor and clicked on Insert image
image
Step 2 - Selected an Image
image
Step 3- Clicked on Insert Image
image
Step 4 - Image inserted
image
Step 5 - Disabled the editor and see the image link (this link stops working after some time)
image

PS: This never works from editor, neither insert nor update. When we disable the editor and use the Insert Image button (the button which shows after disabling the editor) then it works.

Why is this ticket closed?!?!?!?!?!?!

I'm having this exact same issue on Mage 2.2.0

Same issue on 2.2.5 but a little different case.
I have added wysiwyg to the custom widget. It displays directive urls of images and does not convert on frontend to static. If we set directives to true then there is the issue with multiple quotations. To replicate this create a custom widget programatically and add a wyswyg field to the widget options in xml and try adding images and see what happens on frontend and backend. De facto the block stuff works now but these more advanced cases do not work.

Same problem here, just as @goranhorvathr
I'm on 2.3.1 and I've added an imagechooser field to a custom widget. I save it and it works.
As soon as I toggle the editor, the double quotes for the media url get converted to " and the widget breaks.
Impossible to put this in the hands of the customer :(

Still a problem why is this closed?

Same problem here, just as @goranhorvathr
I'm on 2.3.1 and I've added an imagechooser field to a custom widget. I save it and it works.
As soon as I toggle the editor, the double quotes for the media url get converted to " and the widget breaks.
Impossible to put this in the hands of the customer :(

What if you make the custom widget use single quotes?

@magento-engcom-team Reopen this ticket?
Maybe there is another way to reproduce that has not been pinned down yet?

Content that worked fine, when edited and saved is ending up with " where the double quotes were.

<img src="{{media url=&quot;wysiwyg/pearl_theme/chair.png&quot;}}" alt="">

Was this page helpful?
0 / 5 - 0 ratings