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 - issue 8221 #9665

Merged
merged 7 commits into from
Jun 6, 2017

Conversation

thelettuce
Copy link
Contributor

@thelettuce thelettuce commented May 17, 2017

This fixes the problem where if you add a "urlArgs" argument to a requirejs 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)

@ishakhsuvarov ishakhsuvarov self-assigned this Jun 6, 2017
@ishakhsuvarov ishakhsuvarov added this to the June 2017 milestone Jun 6, 2017
@magento-team magento-team merged commit e045c32 into magento:develop Jun 6, 2017
magento-team pushed a commit that referenced this pull request Jun 6, 2017
@magento-team
Copy link
Contributor

@thelettuce thank you for your contribution. Your Pull Request has been successfully merged

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.

4 participants