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

Fix for javascript "mixins" when 'urlArgs' is set in requirejs-config.js - issue 8221 #9664

Closed
wants to merge 3 commits into from

Conversation

thelettuce
Copy link
Contributor

This fixes the problem where if you add a "urlArgs" argument to a requirejs-config.js file, javascript mixins will stop working. For example if you add the line :
urlArgs:urlArgs: "bust=2017-04-21"
to Magento_Theme/templates/page/js/require_js.phtml - this will stop mixins.js from working.
See issue #8221

Description

The problem is due to 'urlArgs' adding a query string to the path variable. The function getMixins in mixins.js tries to reference config using the path variable, but as this includes the query string, it fails.
This change removes the query string from the path variable, allowing config to be referenced correctly.

Fixed Issues (if relevant)

  1. Javascript "mixins" doesn't works if 'urlArgs' is in requirejs-config.js #8221: Javascript "mixins" doesn't works if 'urlArgs' is in requirejs-config.js

Manual testing scenarios

  1. Add urlArgs:urlArgs: "bust=2017-04-21" to any require-js config file on your site.
  2. Test a module that uses javascript mixins or a plugin such as "Fooman GoogleAnalyticsPlus" that uses them.
  3. They will now work.

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

@magento-cicd2
Copy link
Contributor

magento-cicd2 commented May 17, 2017

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


James Reed seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.

@thelettuce thelettuce closed this May 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants