Skip to content

Images inserted in category description broken in the frontend #20031

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
jayanta88 opened this issue Jan 1, 2019 · 9 comments
Closed

Images inserted in category description broken in the frontend #20031

jayanta88 opened this issue Jan 1, 2019 · 9 comments
Labels
Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed

Comments

@jayanta88
Copy link

Preconditions (*)

  1. Magento CE 2.2.3

Steps to reproduce (*)

  1. Login to Admin
  2. Add category description and click WYSIWYG Editor button, it will open a popup.
  3. Then add an image using Insert Image Button there.
  4. Now when you will save it. You will see the image url is like domain.com/admin/cms/wysiwyg/directive/___directive/e3ttZWRpYSB1cmw9Ind5c2l3eWcvYm94LWltZzIuanBnIn19/

Expected result (*)

  1. It should generate pub/media url which will show in frontend.

Actual result (*)

  1. Instead of showing admin image url like domain.com/admin/cms/wysiwyg/directive/___directive/e3ttZWRpYSB1cmw9Ind5c2l3eWcvYm94LWltZzIuanBnIn19/
@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Jan 1, 2019
@magento-engcom-team
Copy link
Contributor

Hi @jayanta88. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento-engcom-team give me $VERSION instance

where $VERSION is version tags (starting from 2.2.0+) or develop branches (for example: 2.3-develop).
For more details, please, review the Magento Contributor Assistant documentation.

@jayanta88 do you confirm that you was able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • yes
  • no

@jayanta88
Copy link
Author

@magento-engcom-team give me 2.2.3 instance

@magento-engcom-team
Copy link
Contributor

Hi @jayanta88. Thank you for your request. I'm working on Magento 2.2.3 instance for you

@magento-engcom-team
Copy link
Contributor

Hi @jayanta88, here is your Magento instance.
Admin access: https://i-20031-2-2-3.instances.magento-community.engineering/admin
Login: admin Password: 123123q
Instance will be terminated in up to 3 hours.

@jayanta88
Copy link
Author

@magento-engcom-team I've reproduced the same issue in the above Magento instance. Please see this http://take.ms/6InZr

@ghost ghost self-assigned this Jan 2, 2019
@magento-engcom-team
Copy link
Contributor

Hi @engcom-backlog-nazar. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 4. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento-engcom-team give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 5. Verify that the issue is reproducible on 2.2-develop branch.

    Details- Add the comment @magento-engcom-team give me 2.2-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.2-develop branch, please add the label Reproduced on 2.2.x

  • 6. Add label Issue: Confirmed once verification is complete.

  • 7. Make sure that automatic system confirms that report has been added to the backlog.

@ghost ghost added the Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed label Jan 2, 2019
@ghost
Copy link

ghost commented Jan 2, 2019

Hi @jayanta88 . Thank you for your report.
The issue has been fixed in #18215 by @adammada in 2.2-develop branch
Related commit(s):

The fix will be available with the upcoming 2.2.8 release.

@ghost ghost closed this as completed Jan 2, 2019
@jayanta88
Copy link
Author

jayanta88 commented Jan 3, 2019

Hi @engcom-backlog-nazar

I've added the fixes. Replaced the method with the below but still, it's generating admin url like admin/cms/wysiwyg/directive/___directive/e3ttZWRpYSB1cmw9Ind5c2l3eWcvY2F0ZWdvcnkvaGVyY3VsZXMuanBlZyJ9fQ,,/

  decodeDirectives: function (content) {
        // escape special chars in directives url to use it in regular expression
        var url = this.makeDirectiveUrl('%directive%').replace(/([$^.?*!+:=()\[\]{}|\\])/g, '\\$1'),
            reg = new RegExp(url.replace('%directive%', '([a-zA-Z0-9,_-]+)')),
            uriReg = /___directive\/(.*)\/key\//g;

        content = content.replace(uriReg, function (match) {
            return decodeURIComponent(match);
        });

        return content.gsub(reg, function (match) { //eslint-disable-line no-extra-bind
            return Base64.mageDecode(match[1]);
        });
    }

@jayanta88
Copy link
Author

@magento-engcom-team -

I've applied the same solution here still this is not working. Is there anything else need to do?

Thanks

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed
Projects
None yet
Development

No branches or pull requests

2 participants