In commerce_kickstart_search.js the following line is part of the behavior added by the module.
$('.facetapi-checkbox').live('click', function(e) {
The live function has been deprecated as of jQuery 1.7 and completely removed as of version 1.9. In themes that override to newer versions of jQuery, or sites that use the jQuery Update module, this generates an error.
If backwards compatibility is essential then bind can be used instead (which in turn calls on).
If being current is more important, the on function can be used in combination with the jQuery Migrate plugin, so that when the plugin is dropped (i.e. CK no longer supports the older versions) no changes are needed in the actual code.
I don't know what the policy is regarding backwards compatibility, but jQuery version is always an issue with new themes (hence the jQuery Update module and theme overrides).
So, just throwing this out there...
Comment | File | Size | Author |
---|---|---|---|
#11 | commerce_search_error-2106687-11.patch | 684 bytes | mglaman |
#8 | commerce_search_error-2106687-8.patch | 682 bytes | mglaman |
#3 | commerce_kickstart-search_js_jquery_latest-2106687-3.patch | 770 bytes | bc |
Comments
Comment #1
gsbc CreditAttribution: gsbc commentedComment #2
lsolesen CreditAttribution: lsolesen commented@gsbc Could you try creating a patch for the change, that you suggest?
Comment #3
bc CreditAttribution: bc commentedI forward-ported in the $.live workaround from jquery-migrate... works like a charm.
Comment #4
bc CreditAttribution: bc commentedComment #5
urecheatu007 CreditAttribution: urecheatu007 as a volunteer commentedI just tested this patch on a fresh install of commerce kickstart with jquery update (1.10) and it seems to be working fine.
Comment #6
dthorberg CreditAttribution: dthorberg commentedAgreed I also just patched this on a new copy of D7 with the latest patch. Fixed my javascript woes. (Version 7x.2.25)
Comment #7
mglamanIf this can be resolved by just using bind then I'd rather do that, then this workaround.
Comment #8
mglamanAfter reading this: http://elijahmanor.com/differences-between-jquery-bind-vs-live-vs-delega..., I think we can just change live to on method.
Here is the PR https://github.com/commerceguys/commerce_kickstart/pull/120
Comment #9
bc CreditAttribution: bc commentedThe "oldLive" patch keeps compatibilty with jQuery versions < 1.9.
Comment #10
mglamanOk, I'm moving back to needs work. Totally missed .on() was added in 1.7 and Drupal ships with 1.4. My one thought is "we're not the only ones with this issue." The patch in #3 creates our own work around. I'd rather investigate what other contributed projects are doing, too.
Comment #11
mglamanI'd rather just stick with bind rather than other workarounds, if we can.
Link to Travis build: https://travis-ci.org/commerceguys/commerce_kickstart/builds/70471380
Comment #12
mglamanTests pass!
Comment #14
mglaman