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.1.9 wysiwyg upload images broken in frontend #11131

Closed
Ayaname0330 opened this issue Sep 29, 2017 · 7 comments
Closed

Magento 2.1.9 wysiwyg upload images broken in frontend #11131

Ayaname0330 opened this issue Sep 29, 2017 · 7 comments
Assignees
Labels
Issue: Cannot Reproduce Cannot reproduce the issue on the latest `2.4-develop` branch Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed

Comments

@Ayaname0330
Copy link

Preconditions

1.Magento 2.1.9

Steps to reproduce

1.click the Insert/Edit image
2.choose a image
3.save

Expected result

1.the image show in frontend

Actual result

1.the image broken
2.the url contains '/cms/wysiwyg/directive/___directive'

@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Sep 29, 2017
@magento-engcom-team
Copy link
Contributor

@Ayaname0330, thank you for your report.
We were not able to reproduce this issue by following the steps you provided. Please provide more detailed steps to reproduce.

@barryvdh
Copy link
Contributor

barryvdh commented Sep 29, 2017

I have the same issue when editing Content -> Pages. After inserting image via the editor -> Insert Image -> browse, the link looks like http://mydomain.com/admin_123/cms/wysiwyg/directive/___directive/e3ttZWRpYSB1cmw9Ind5cqLWRlLWtpcC5wbmcifX0%2C/key/2cda8ae0fd4ce300714c145c72b7c42a99a3fb2fa2485584/
This link isn't replaced when saving and will 404 when shown on the frontend.

@PieterCappelle
Copy link
Contributor

Hi, this is related to this issue #10417 and fixed with my PR #11048

@magento-engcom-team magento-engcom-team added Issue: Cannot Reproduce Cannot reproduce the issue on the latest `2.4-develop` branch and removed Progress: needs update labels Oct 3, 2017
@magento-engcom-team
Copy link
Contributor

@Ayaname0330, 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.2.0, 2.1.9

@erikkubica
Copy link

erikkubica commented Mar 6, 2018

@magento-engcom-team @PieterCappelle this happens when you copy paste content from wysiwyg A to wysiwyg B where is image, the image url in this case is special url that requires to be logged in into admin to be able to see the image. At least this was our case. After we inserted/replaced image manually using the insert image in wysiwyg B, the image started working.

@damjess
Copy link

damjess commented Mar 12, 2018

Experiencing the same issue here. The image is saved with a backend url that is not visible to anyone outside of the admin account that "placed" the image using wysiwyg. I've tried uploading again and placing each image (no copy + paste) and the problem still occurs. Running 2.1.10

@carloricci84
Copy link

I fixed this problem in 2.1.11 by overriding the class Magento\Framework\Event\ObserverInterface\CatalogCheckIsUsingStaticUrlsAllowedObserver

I added a verification on the store id to set it to 0 if it is an empty string and it works correctly now. It will only works if you have the setting "Use Static URLs for Media Content in WYSIWYG for Catalog" set to yes in Configuration -> General -> Content Management.

public function execute(\Magento\Framework\Event\Observer $observer){
        $storeId = $observer->getEvent()->getData('store_id');
        $result = $observer->getEvent()->getData('result');

        if($storeId == ""){
            $storeId = 0;
        }

        $result->isAllowed = $this->catalogData->setStoreId($storeId)->isUsingStaticUrlsAllowed();
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: Cannot Reproduce Cannot reproduce the issue on the latest `2.4-develop` branch Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed
Projects
None yet
Development

No branches or pull requests

7 participants