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

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

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

Comments

Projects
None yet
@forvin
Copy link

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

This comment has been minimized.

Copy link
Contributor

commented Aug 15, 2016

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

@allanpaiste

This comment has been minimized.

Copy link
Contributor

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

This comment has been minimized.

Copy link
Contributor

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

This comment has been minimized.

Copy link
Contributor

commented Aug 29, 2016

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

@devhn

This comment has been minimized.

Copy link

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

Merge pull request #505 from magento-falcons/MAGETWO-59693
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

This comment has been minimized.

Copy link
Member

commented Oct 17, 2016

Hi @forvin

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

@christian-walker

This comment has been minimized.

Copy link

commented Oct 17, 2016

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

@ferrarinim

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link
Member

commented Nov 4, 2016

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

@ferrarinim

This comment has been minimized.

Copy link

commented Nov 4, 2016

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

This comment has been minimized.

Copy link

commented Nov 12, 2016

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

@minhluan259

This comment has been minimized.

Copy link

commented Nov 12, 2016

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

@korostii

This comment has been minimized.

Copy link

commented Jul 3, 2017

Hi @treestonemedia, actually, 2.1.6 is already released, as well as 2.1.7 :)

Anyway, the only release guaranteed to have this fix included is 2.2.0.
Judging by the past experience, porting it to 2.1.x might take forever or longer.

@treestonemedia

This comment has been minimized.

Copy link

commented Jul 3, 2017

@korostii ok - so what IS the solution?

@hostep

This comment has been minimized.

Copy link
Contributor

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 added a commit to hostep/magento2 that referenced this issue Jul 3, 2017

MAGETWO-57796: [GitHub] Inserted image in product description got bro…
…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

This comment has been minimized.

Copy link

commented Jul 3, 2017

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

This comment has been minimized.

Copy link
Contributor

commented Jul 5, 2017

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

This comment has been minimized.

Copy link
Contributor

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

This comment has been minimized.

Copy link
Contributor

commented Jul 31, 2017

Internal ticket to track issue progress: MAGETWO-70435

@magento-engcom-team

This comment has been minimized.

Copy link
Contributor

commented Sep 20, 2017

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

@kenmaxnejp

This comment has been minimized.

Copy link

commented Oct 16, 2017

Issue still exists in Magento 2.2.0.

@hostep

This comment has been minimized.

Copy link
Contributor

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

This comment has been minimized.

Copy link

commented Oct 17, 2017

@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

This comment has been minimized.

Copy link

commented Apr 3, 2018

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

@Vishrootways

This comment has been minimized.

Copy link

commented Apr 5, 2018

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

@hostep

This comment has been minimized.

Copy link
Contributor

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

This comment has been minimized.

Copy link

commented Apr 5, 2018

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

This comment has been minimized.

Copy link

commented Apr 21, 2018

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

@hostep

This comment has been minimized.

Copy link
Contributor

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.