Skip to content

inserted image in product description got broken on front end #6138

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

Closed
forvin opened this issue Aug 12, 2016 · 52 comments
Closed

inserted image in product description got broken on front end #6138

forvin opened this issue Aug 12, 2016 · 52 comments
Labels
bug report Component: Catalog Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development

Comments

@forvin
Copy link

forvin commented Aug 12, 2016

My site is built by Magento 2.1. Newly added products will not appear until you manually re-index via SSH. But inserted image in product description will break after you re-index your magento. Anybody know how to fix the two problems? Thank you !

@wert2all
Copy link
Contributor

Please, format this issue according to the Issue reporting guidelines: with steps to reproduce, actual result and expected result.

@allanpaiste
Copy link

allanpaiste commented Aug 21, 2016

Preconditions

Using custom Ubuntu xenial vagrant-box, php7, apache

  1. Have latest stable release of Magento 2.1 installed.
  2. Install sample data (sampledata:deploy).
  3. {optional} disable xdebug php module (makes testing faster).
  4. {optional} disable js merging/minifying (if running in developer mode, makes testing faster).

Steps to reproduce

  1. Log into admin
  2. Navigate to PRODUCTS >> Inventory >> Catalog
  3. Filter the list by name: "Breathe-Easy Tank"
  4. Select the product that has that exact name (should be last in the list)
  5. In the editor form open up: Content >> Description
  6. Enable WYSIWYG editor
  7. Use the Insert/Edit image icon in the editor toolbar
  8. Use the "Browse" icon/button (it's next to "Image url" field) in the popup that opens
  9. Choose any image
  10. (the image will show up in the product description area)
  11. save the product
  12. switch to storefront in another tab
  13. search for "Breathe-Easy Tank"
  14. choose the product in result that has that exact name
  15. find the product description on the page (the added image should be visible there)
  16. [admin tab] sign out from admin
  17. [storefront tab] reload the category page

Expected result

Image gets rendered in the description area

Actual result

Image is not rendered, instead you get broken image link icon

Notes

What I have now experienced is that the media directive in product description never gets converted to the common format of {{media}}. Instead, it remains an admin link. This means that it kind of looks OK for you after you have saved it and remain logged in in admin, but as soon as you log out or as soon as someone else visits the product page - the image link is broken.

Seems that same happens with category description. Even if you try to use media directives, they never get converted to proper image url's.

Issue prevalent: product pages, category pages.

@kassner
Copy link
Contributor

kassner commented Aug 25, 2016

The actual URL generated in the frontend for the image is similar to:

http://magento.dev/admin/cms/wysiwyg/directive/___directive/e3ttZWRpYSB1cmw9Ind5c2l3eWcvXzkwODgyOTA2X21lZGlhaXRlbTkwODgyOTA1LmpwZyJ9fQ,,/key/63c0a22e66f27a455e7909536728d8fe3fe5042ab22c7813ddd77c476c6a2f15/

Accessing the url directly redirects you to the admin dashboard (if logged in).

@dthampy dthampy self-assigned this Aug 29, 2016
@dthampy dthampy added the Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development label Aug 29, 2016
@dthampy
Copy link
Contributor

dthampy commented Aug 29, 2016

Internal ticket ->MAGETWO-57796 has been created for this issue. Thank you for the detailed bug report.

@devhn
Copy link

devhn commented Oct 14, 2016

Same problem as @allanpaiste. Revealing admin url is a security issue:

http://domain.com/admin_x8ds75/cms/wysiwyg/directive/___directive/e3ttZWRpYSB1cmw9Ind5c2l3eWcvZ2lmdGNhcmRzL3Rlc3QuanBnIn19/key/33b667a795c3983972e19c299be458e89007ce028ff3c58cbe264eabadee061a/

We have a lot of product descriptions which show a broken image and it happens only when administrator log's out from Magento admin. This should be high priority.

mmansoor-magento pushed a commit that referenced this issue Oct 17, 2016
Bugs:
* MAGETWO-57796: [GitHub] Inserted image in product description got broken on front end #6138
* MAGETWO-54253: Export filters for products do not work
@shiftedreality
Copy link
Member

Hi @forvin

This issue was fixed in develop branch and will be ported to 2.1.x branch.
Closed.

@christian-walker
Copy link

@shiftedreality is there a timetable for when it will be ported over to the 2.1.x branch?

@ferrarinim
Copy link

ferrarinim commented Nov 4, 2016

I've downloaded and replace the file into the server folder lib/web/mage/adminhtml/wysiwyg/tiny_mce/setup.js

but I'm still having the problem...

f

@shiftedreality
Copy link
Member

Hi @ferrarinim. Please re-edit your product description, because you have corrupted data in your DB.

@ferrarinim
Copy link

Hi @shiftedreality... I've tried but after some time the image disappears...
look at http://www.e-miko.com/mayliss-chelsea-vernice-black.html

@minhluan259
Copy link

minhluan259 commented Nov 12, 2016

I've update two files setup.js and Eav.php
But I still have same issue #7393

@minhluan259
Copy link

@shiftedreality , @mmansoorebay
I've tested in product page, the issue was fixed.
But it's not fix in category page.

@hostep
Copy link
Contributor

hostep commented Jul 3, 2017

@treestonemedia: scroll up a little bit to the comment from @Talv, he mentions a small extension which might fix this.

@okorshenko: are there already plans to backport MAGETWO-57796 and MAGETWO-66885 to 2.1.x? If not, I'll try creating a PR for this.

hostep pushed a commit to hostep/magento2 that referenced this issue Jul 3, 2017
…ken on front end magento#6138

(cherry picked from commit a657749)

MAGETWO-57796: [GitHub] Inserted image in product description got broken on front end magento#6138

(cherry picked from commit e3d67ea)

MAGETWO-57796: [GitHub] Inserted image in product description got broken on front end magento#6138

(cherry picked from commit 228ee3a)

MAGETWO-57796: [GitHub] Inserted image in product description got broken on front end magento#6138

(cherry picked from commit 9030e08)
@judaschwartz
Copy link

OK so i tried the sulotion by @Talv and it breaks the images becuase it just inserts this into the html <img src="{{media url=" wysiwyg="" product-tables="" csimg.jpg"}}"="" width="718" height="1200"> any ideas

okorshenko pushed a commit that referenced this issue Jul 5, 2017
@okorshenko
Copy link
Contributor

Hi @hostep
We just created new branch 2.1.8-preview. Please checkout this branch to see what issues will be included to next patch release. We are still pushing new fixes to this branch.

@hostep
Copy link
Contributor

hostep commented Jul 5, 2017

Nice job @okorshenko, this is another huge step forwards in better communicating to the community about what is happening internally, very happy to see this happening!
I'm assuming this will happen for all upcoming minor releases from now on?

If I may, some other things you might consider:

  • Use the Milestones feature for every upcoming release, so we can see what github issues are supposed to be solved in a particular new release.
  • And it would also be highly appreciated if new minor releases are released much more frequently, like every few weeks and contain a small amount of fixes, like 10 bug fixes per release is more then enough. With the current pace (which is really slow) of releasing minor releases and the huge amount of changes in a minor release it's much harder to understand what is happening. And it comes at quite a big cost to upgrade to a new minor release (especially if you are maintaining multiple projects like we do). And it can also get frustrating if bugs aren't getting solved over multiple months sometimes.

I already mentioned these things a couple of times in the past, but I don't think it hurts to remind you guys about this.

Anyway, I don't want to complain too much, we've seen huge leaps forwards since the beginning of 2017 about communicating towards the community, so big applause for that 👏 👍

(Also big thanks to @korostii, I think his comments have helped to accomplish this new step forwards as well.)

@magento-team
Copy link
Contributor

Internal ticket to track issue progress: MAGETWO-70435

@magento-engcom-team magento-engcom-team added 2.1.x Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development bug report Component: Catalog Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed labels Sep 11, 2017
@magento-engcom-team
Copy link
Contributor

@forvin, thank you for your report.
The issue is already fixed in 2.2.0

@kenmaxnejp
Copy link

Issue still exists in Magento 2.2.0.

@hostep
Copy link
Contributor

hostep commented Oct 16, 2017

@kenmaxnejp: yes indeed, but the cause of the bug is different this time. The new bug should get fixed by 6237877. I believe the fix is scheduled to be part of Magento 2.2.2 which should get released by the end of this year from what I've heard.

@kenmaxnejp
Copy link

@hostep Thanks for the update. I confirmed the fix 6237877 works in Magento 2.2.0. I posted those images all over again after I edited the file and it works. Actually I cannot find app/code/Magento/Cms/Helper/Wysiwyg/Images.php, so I edited vendor/magento/module-cms/Helper/Wysiwyg/Images.php instead.

@Vishrootways
Copy link

How to solve this error in Magento 2.1.8 version? Please help us if anyone know.

@Vishrootways
Copy link

How to solve this error in Magento 2.1.8 version? Please help us if anyone know.

@hostep
Copy link
Contributor

hostep commented Apr 5, 2018

@Vishrootways: update to a newer version of Magento, it was fixed in 2.1.9 or 2.1.10 if I remember correctly.

@Vishrootways
Copy link

Hi @hostep thank you. Is there any patch to solve this issue in 2.1.8?
and also we are getting this issue in 2.2.2.

@pradeepnew
Copy link

pradeepnew commented Apr 21, 2018

We are getting this issue in magento version 2.2.2 and 2.2.3. Any solution?

@hostep
Copy link
Contributor

hostep commented Apr 24, 2018

@pradeepnew or @Vishrootways: can you open a new issue with the exact steps to reproduce this on a clean installation, that would be really appreciated!

@BB-000
Copy link

BB-000 commented Dec 4, 2019

I am having very similar issue (just not on product description) on 2.3.1...... 🤦‍♂️

mmansoor-magento pushed a commit that referenced this issue May 11, 2021
[TSG-CSL3] For 2.3.7-develop (MC-37104)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Component: Catalog Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development
Projects
None yet
Development

No branches or pull requests