Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Error: [Exception... "'Syntax error, unrecognized expression: [@type="checkbox"]' when calling method: [nsIDOMEventListener::handleEvent]" nsresult: "0x8057001e (NS_ERROR_XPC_JS_THREW_STRING)" location: "" data: no]
@type="checkbox" is not a normal js thing?
This is in betterselect.js >
Drupal.behaviors.initBetterSelect = function(context) {
$('.better-select .form-checkboxes input[@type="checkbox"]').click(function(){
this.checked ? $(this).parent().parent().addClass('hilight') : $(this).parent().parent().removeClass('hilight');
}).filter(":checked").parent().parent().addClass('hilight');
}
Comment | File | Size | Author |
---|---|---|---|
#21 | betterselect_510012.patch | 561 bytes | robcarr |
#19 | jquery-update-compatibility.patch | 673 bytes | Bartezz |
#4 | betterselect-510012_selector-fix.patch | 616 bytes | recrit |
Comments
Comment #1
kenorb CreditAttribution: kenorb commentedRelated issue: #578924: Syntax error, unrecognized expression: [@type=checkbox]
Comment #2
kenorb CreditAttribution: kenorb commentedTry input:checked instead of input[@type=checkbox]
Comment #3
markabur CreditAttribution: markabur commentedyes, related to installing the jquery update module.
what works for me is input[type=checkbox] instead of input[@type=checkbox] -- which makes sense as the former is the correct css syntax. i guess jquery is pickier than it used to be.
Comment #4
recrit CreditAttribution: recrit commentedthank you markabur! this fixed the issue I was having.
created a simple patch to change the js file
Comment #5
wanjee CreditAttribution: wanjee commentedPatch #4 is also the fix that worked for us.
Would it be applied to final 5.x ?
Comment #6
mdeltito CreditAttribution: mdeltito commentedto be proper, the jQuery syntax is:
input[type="checkbox"]
xpath selectors are deprecated in jQuery >= 1.3.1
Comment #7
recrit CreditAttribution: recrit commented@mdeltito that is exactly what the #4 patch accomplishes.
Comment #8
tuffnatty CreditAttribution: tuffnatty commentedinput:checkbox looks better to me but this also works.
Comment #9
mdeltito CreditAttribution: mdeltito commentedmy understanding is that colon (:) selectors are marginally slower than the explicit [attr="val"] selector
Comment #10
kmonty#4 works great.
Comment #11
kmontyComment #12
kmontywhoops
Comment #13
buddaWorks well. Release time? :-)
Comment #14
kmontyFrom http://api.jquery.com/category/selectors/attribute-selectors/
Note: In jQuery 1.3 [@attr] style selectors were removed (they were previously deprecated in jQuery 1.2). Simply remove the ‘@’ symbol from your selectors in order to make them work again.
Comment #15
clashar CreditAttribution: clashar commentedsubscribe
Comment #16
benoit.borrel CreditAttribution: benoit.borrel commentedsubscribe++
Comment #17
gonzgonz CreditAttribution: gonzgonz commentedSubscribing, please :)
Comment #18
rhymeswithcamera CreditAttribution: rhymeswithcamera commentedI just installed Better Select yesterday. I am running jQuery 1.3 and can confirm that all is well. [I had to install jQuery Update awhile back to work with Modal Frame API.]
Comment #19
Bartezz CreditAttribution: Bartezz commentedTested changes as mentioned in #4 which solves problems with jquery_update module.
Patch didn't work for me so created new patch based on latest 6.x-1.0-beta2
Cheers
Comment #20
Alex Andrascu CreditAttribution: Alex Andrascu commentedYep. Patch's good. Subscribing
Comment #21
robcarrI've just tried latest DEV (25 Feb 11) and it breaks with jQuery Update - specifically wysiwyg/tinymce, lightbox2 and text autocomplete in CCK fails on the node edit form. Removal of the '@' symbol in betterselect.js (as discussed by @kmonty in #14) and all is fine again.
** edit - Vertical tabs also breaking without the '@' removal. This issue maybe the problem at #429668: Clash with Vertical Tabs Module
Roll patch against DEV
Comment #22
markabur CreditAttribution: markabur commentedLatest patch applies cleanly to 6.x-1.x-dev and solves the problem, thanks for the reroll.
Comment #23
dgsiegel CreditAttribution: dgsiegel commentedsubscribing
Comment #24
simon.mittelberger CreditAttribution: simon.mittelberger commentedworks for 6.x-1.x-beta2, thanks
Comment #25
markabur CreditAttribution: markabur commentedPatches go against -dev
Comment #26
univate CreditAttribution: univate commentedpatch in #21 fixed for me.
Comment #27
TimelessDomain CreditAttribution: TimelessDomain commented#21 works - lets get this committed
Comment #28
stoatoffear CreditAttribution: stoatoffear commented#3 works for me.
Comment #29
upupax CreditAttribution: upupax commentedPatch #4 works for me.
Comment #30
artis CreditAttribution: artis commentedThis bug broke a lot of js on our clients site and took nearly an hour of work to track down and fix.
Please commit this to a new release!
Thanks.
Comment #31
kenorb CreditAttribution: kenorb commented+1 for commit
Comment #32
ipwa CreditAttribution: ipwa commentedI will test this patch but it looks like for most people lots working correctly. If more people test the patch it'd be great, I can ask the maintainer to give add me as a temporary co-maintainer to commit this and make a new dev release.
Comment #33
robcarrIts status has been RTBC for 5 months... Status settings for an issue.
Comment #34
markabur CreditAttribution: markabur commentedYes, this patch still works fine. I have used it in many production sites.
Comment #35
ressa CreditAttribution: ressa commentedIt works, and should be committed.
Comment #36
jenlamptonpatch still applies, and solves the problem.
(I also noticed that the fieldset behavior in core was broken without this fix - will be great to get it in!)
Comment #37
ipwa CreditAttribution: ipwa commentedI was added as a co-maintainer. I'm on vacations, but will be back in my office next week, will commit the patch then.
Comment #38
jenlamptonGreat, thank you! :)
Comment #39
ipwa CreditAttribution: ipwa commentedI re-confirmed the bug in a fresh Drupal 6 install, and applied the patch that solved it. Committed, thanks to everyone involved good work! People who helped with the patch where credited: http://drupal.org/commitlog/commit/6308/22e9a74251e22d61cbf976c99d3633aa...
We now have a new beta3 release :)
Comment #40
Bartezz CreditAttribution: Bartezz commentedCheers!