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

Marketing Email preview doesn't work with enabled js minification #25068

Closed
ihor-sviziev opened this issue Oct 15, 2019 · 38 comments
Closed

Marketing Email preview doesn't work with enabled js minification #25068

ihor-sviziev opened this issue Oct 15, 2019 · 38 comments
Assignees
Labels
Component: Backend Component: Email Fixed in 2.3.x The issue has been fixed in 2.3 release line Fixed in 2.4.x The issue has been fixed in 2.4-develop branch Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release

Comments

@ihor-sviziev
Copy link
Contributor

ihor-sviziev commented Oct 15, 2019

Preconditions (*)

  1. Magento 2.3.2-p2, Magento 2.3.3, Magento 2.3-devlop
  2. Enable JS minification in Admin >> Stores >> Configuration >> JavaScript Settings >> "Minify JavaScript Files" set to "Yes"
  3. Switch magento to production mode

Steps to reproduce (*)

  1. Go to Admin >> Marketing >> Communications >> Email Templates
  2. Click "Add New Template"
  3. Select "New Order" template
  4. Click "load template" button
  5. Fill up "Template Name" with "New Order"
  6. Click "Save Template" button
  7. In the email templates grid click on "Preview" link in "Actions" column

Expected result (*)

  1. You should see email template preview in opened popup
  2. There should not be any JS errors

Actual result (*)

  1. Email Preview popup is empty
    image
  2. We have JS error
    image

Failed to load resource: the server responded with a status of 404 ()
Uncaught Error: Script error for: jquery

@m2-assistant
Copy link

m2-assistant bot commented Oct 15, 2019

Hi @ihor-sviziev. 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 give me 2.3-develop instance - upcoming 2.3.x release

For more details, please, review the Magento Contributor Assistant documentation.

@ihor-sviziev do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • yes
  • no

@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Oct 15, 2019
@shikhamis11 shikhamis11 self-assigned this Oct 15, 2019
@m2-assistant
Copy link

m2-assistant bot commented Oct 15, 2019

Hi @shikhamis11. 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 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. Add label Issue: Confirmed once verification is complete.

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

@shikhamis11
Copy link
Member

@magento give me 2.3-develop instance

@magento-engcom-team
Copy link
Contributor

Hi @shikhamis11. Thank you for your request. I'm working on Magento 2.3-develop instance for you

@magento-engcom-team
Copy link
Contributor

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

@shikhamis11
Copy link
Member

Hello @ihor-sviziev
thank you for reporting this issue , I checked it on 2.3-develop instance email template preview works fine , there are some errors on console but those are related to CORS .
Can you Please take a look ?

@ihor-sviziev
Copy link
Contributor Author

ihor-sviziev commented Oct 15, 2019

@ihor-sviziev
Copy link
Contributor Author

Hi @shikhamis11,
Now 2.3.3 release was merged, could you double check it again?

@ihor-sviziev
Copy link
Contributor Author

@magento give me 2.3-develop instance

@magento-engcom-team
Copy link
Contributor

Hi @ihor-sviziev. Thank you for your request. I'm working on Magento 2.3-develop instance for you

@ihor-sviziev
Copy link
Contributor Author

@magento give me 2.3-develop instance

@magento-engcom-team
Copy link
Contributor

Hi @ihor-sviziev. Thank you for your request. I'm working on Magento 2.3-develop instance for you

@magento-engcom-team
Copy link
Contributor

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

@ihor-sviziev
Copy link
Contributor Author

@shikhamis11 just updated steps to reproduce, we have to have production mode, while on test instance we don't have production mode :(

@shikhamis11
Copy link
Member

Hello @ihor-sviziev you can have production mode in test instance
Just add pub/testing in instance url

@ihor-sviziev
Copy link
Contributor Author

@magento give me 2.3-develop instance

@magento-engcom-team
Copy link
Contributor

Hi @ihor-sviziev. Thank you for your request. I'm working on Magento 2.3-develop instance for you

@ihor-sviziev
Copy link
Contributor Author

@magento give me 2.3-develop instance

@magento-engcom-team
Copy link
Contributor

Hi @ihor-sviziev. Thank you for your request. I'm working on Magento 2.3-develop instance for you

@magento-engcom-team
Copy link
Contributor

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

@ihor-sviziev
Copy link
Contributor Author

I was able to reproduce this issue on test instance.

Just updated issue description with exact steps to reproduce and screenshots of actual result.

@shikhamis11 shikhamis11 added Component: Backend Component: Email Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release labels Oct 28, 2019
@ghost ghost unassigned shikhamis11 Oct 28, 2019
@magento-engcom-team magento-engcom-team added the Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development label Oct 28, 2019
@magento-engcom-team
Copy link
Contributor

✅ Confirmed by @shikhamis11
Thank you for verifying the issue. Based on the provided information internal tickets MC-22163 were created

Issue Available: @shikhamis11, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

@LucasCalazans
Copy link
Member

@magento give me 2.3-develop instance

@magento-engcom-team
Copy link
Contributor

Hi @LucasCalazans. Thank you for your request. I'm working on Magento 2.3-develop instance for you

@magento-engcom-team
Copy link
Contributor

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

@arnobsh arnobsh self-assigned this Dec 5, 2019
@m2-assistant
Copy link

m2-assistant bot commented Dec 5, 2019

Hi @arnobsh. Thank you for working on this issue.
Looks like this issue is already verified and confirmed. But if you want to validate it one more time, please, go though the following instruction:

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

  • 2. Verify that the issue is reproducible on 2.4-develop branch

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

  • 3. If the issue is not relevant or is not reproducible any more, feel free to close it.


@arnobsh
Copy link
Contributor

arnobsh commented Dec 5, 2019

Internal Magento team is working on this issue right now

@arnoudhgz
Copy link
Contributor

arnoudhgz commented Dec 9, 2019

The issue is, that somehow jquery.js is requested while jquery.min.js should be loaded. A workaround until the actual solution is found is to create a symlink named jquery.js that points to jquery.min.js in pub/static/versionxxx/adminhtml/Magento/backend/en_US.

Of course replace versionxxx and en_US to your appropriate paths, versionxxx is only needed when static signing enabled.

@magento-engcom-team magento-engcom-team added the Fixed in 2.3.x The issue has been fixed in 2.3 release line label Dec 10, 2019
@magento-engcom-team
Copy link
Contributor

Hi @ihor-sviziev, @arnobsh.

Thank you for your report and collaboration!

The issue was fixed by Magento team.

@arnoudhgz
Copy link
Contributor

@magento-engcom-team where is the fix?

@magento-engcom-team
Copy link
Contributor

Hi @ihor-sviziev, @arnobsh.

Thank you for your report and collaboration!

The issue was fixed by Magento team. The fix was delivered into magento/magento2:2.3-develop branch(es).
Related commit(s):

The fix will be available with the upcoming 2.3.5 release.

@AlexanderSk
Copy link

hello guys, i just faced this issue one 2.3.3 and searched for this ticket and that it hopefully will be fine on 2.3.5.

i would only like to note that i did try to copy paste the jsuery.min.js to jquery.js and i get an error: Uncaught SyntaxError: Unexpected end of input for jquery.js

the actual file is this one if you would like to have a look.
https://tyanabelle.com/pub/static/version1576220203/adminhtml/Magento/backend/en_US/jquery.js

Thank you for your time and effort.

@magento-engcom-team
Copy link
Contributor

Hi @ihor-sviziev, @arnobsh.

Thank you for your report and collaboration!

The issue was fixed by Magento team. The fix was delivered into magento/magento2:2.4-develop branch(es).
Related commit(s):

The fix will be available with the upcoming 2.4.0 release.

@magento-engcom-team magento-engcom-team added the Fixed in 2.4.x The issue has been fixed in 2.4-develop branch label Dec 16, 2019
@linardskrumins
Copy link

Hey @magento-engcom-team

Were these commits deleted? The commit page for both commits is not found

@ihor-sviziev
Copy link
Contributor Author

@linardskrumins now this link available e8eb43a

@adarshkhatri
Copy link
Contributor

adarshkhatri commented May 19, 2020

Still happening in 2.3.3-p1. The system is looking for jquery.js instead of jquery.min.js.

A quick (temporary) solution would be to duplicate jquery.min.js and rename it to jquery.js in pub/static/adminhtml/Magento/backend/en_US

@Eddcapone
Copy link

Eddcapone commented Mar 29, 2021

Does not work in 2.4.2 Enterprise in production mode. I get "Blocked script execution in '' because the document's frame is sandboxed and the 'allow-scripts' permission is not set."

Is it because I have disabled the module Magento_Csp?

image

EDIT: Solved. It was not because of the javascript. It was caused because the included header could not get loaded, because it was set to a non existing template in "Content -> Design: Configuration -> Theme -> Transaction E-Mails". The problem was caused after copying a database to another project. The error was present in that other project only.

@ihor-sviziev
Copy link
Contributor Author

@Eddcapone, it looks like a bit different issue. Could you report it separately?
Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Backend Component: Email Fixed in 2.3.x The issue has been fixed in 2.3 release line Fixed in 2.4.x The issue has been fixed in 2.4-develop branch Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release
Projects
None yet
Development

No branches or pull requests

10 participants