Hi,

In my console I'm getting consistent errors being output when I try to use the hs_menu module. Every time I select a menu I get the error:

jquery.min.js:16Uncaught Syntax error, unrecognized expression: [value=main-menu:0]
OR
jquery.min.js:16Uncaught Syntax error, unrecognized expression: [value=menu-secondary-links:0]

I'm using the Google CDN of jQuery and jQuery UI. This is completely breaking the hierarchical select of the menu for me. Has anyone else had this issue?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

acbramley’s picture

Probably worth noting I am using hs_taxonomy and it works fine.

wiifm’s picture

Issue tags: +jquery_update

Having the same issue,

on removing the jquery_update module, and bring jQuery back to stock 1.4.4 hs_menu started working again.

Perhaps this is an issue with the selector being used?

Anyone care to comment

acbramley’s picture

Project: Hierarchical Select » jQuery Update
Version: 7.x-3.0-alpha5 » 7.x-2.2
Component: Code - Menu » Code

Switching issue queues as this is caused by jquery_update.

acbramley’s picture

The only line in hierarchical_select.js that I can find that is using this [value=''] is line 475:

var optionClass = $('#'+ settings.select_id).find('option[value='+ value +']').attr('class');
acbramley’s picture

Project: jQuery Update » Hierarchical Select
Version: 7.x-2.2 » 7.x-3.0-alpha5
Status: Active » Needs review
FileSize
1.08 KB

This patch fixes the error and works both with jquery_update module turned off and turned on.

coreyp_1’s picture

Status: Needs review » Reviewed & tested by the community

#5 fixed our issue. We were using the hierarchical select in a custom form element, and it would die after the second level due to the value variable. The patch wraps the value with a double quote, which should always be done, anyway, so I believe that this is the correct fix.

Seeing as this has languished for about a year, I'm marking it as rtbc.

cravecode’s picture

I was going to commit the same fix. Works for me on jQuery 1.8.3. Curious as to why this hasn't been merged.

sylus’s picture

Attaching patch for latest dev:

milovan’s picture

Patch @ #5 is also applicable on Hierarchical select for Drupal 6 and fixes exactly the same error.
Thanks for the patch!

acbramley’s picture

@sylus my patch applied fine to the latest dev, no need to upload duplicates.

HansKuiters’s picture

Patch #8 works great for dev. Thanks.

acbramley’s picture

Priority: Major » Critical

Please can we commit this 2 year old issue! Please commit #5

Wim Leers’s picture

Status: Reviewed & tested by the community » Fixed

Automatically closed -- issue fixed for 2 weeks with no activity.

Corwin’s picture

I'm having this issue when jQuery update is enabled however I am not using the hierarchical_select modules. I do have og_menu installed.

Uncaught Error: Syntax error, unrecognized expression: [value=menu-main-menu:0]

milovan’s picture

Issue summary: View changes
Status: Closed (fixed) » Patch (to be ported)
Issue tags: +D6 patch port

Hey, since patch is applicable on Drupal 6 as well and fixes the same issue there, can you also commit it for D6, please?

  • stefan.r committed 324e37c on 6.x-3.x authored by sylus
    Issue #1315192 by acbramley, sylus: Uncaught Syntax error, unrecognized...
stefan.r’s picture

Status: Patch (to be ported) » Fixed

Committed to 6.x-3.x-dev, thanks

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.