Hi

The jquery selectors may be broken. e.g. a search for "womens'" with the apostrophe on the end results in an error:

uncaught exception: Syntax error, unrecognized expression: value=n\'s]

The attached patch, just removes these. I don't think checkbox should have a value of "womens'" anyway. Just escaping the characters didn't work. Perhaps the values should be encoded on both sides?

The attached patch makes it work in our scenario.

Thanks
John

Comments

heddn’s picture

Status: Active » Needs review
jdanthinne’s picture

Status: Needs review » Postponed (maintainer needs more info)

@jrobens : sorry for the delay… is this still happening? And then, can you explain when does this exception happen? Before searching, on the results…?

nemanja’s picture

Issue summary: View changes

Type this string for example - qowepurcmnv'
On page after submit you will get javascript error.
Syntax error, unrecognized expression: value=purcmnv']
You can also try any other non alphanumeric string (qowepurcmnv.)...

jdanthinne’s picture

@Nemanja: have you tried the patch?

nemanja’s picture

Yes, sorry, it works for most of characters but when we have question mark "?" in it, it doesn't.
I am not sure how this jquery selectors could be changed in order to make this work but it's definitely problem in them.

jdanthinne’s picture

Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new2.29 KB

Can you try this modified patch? I've included the question mark in the characters to remove.

nemanja’s picture

StatusFileSize
new2.12 KB

Here is my patch. Using regular expressions can always make problems if some character isn't included in pattern so i used this as solution...

jdanthinne’s picture

If it's ok for you, I can commit the patch, but perhaps I should wait for a review from jrobens (who did the original patch).

nemanja’s picture

I am fine with that, but also i agree with you. Approval from more people is better anyway

jrobens’s picture

I tried to re-test it using the site that we were building at the time. Can't quite get here easily.

I agree, regular expressions are untidy. I wanted to escape the characters so that they wouldn't get in the way. It was for some checkbox taxonomy solution. [] womens' wasn't appropriate.

This fix looks like the problem is wrapped try/catch. Does this mean that it doesn't check the check when it is supposed to, so the facet feature won't work in these cases?

I'll see if I can find a config for this.

jrobens’s picture

The site that I was working on is still running the same code here: http://community.sunshinecoast.qld.gov.au/search/apachesolr_search/women%27s?filters=tid%3A4631

The types list is pull down next to 'Search All'. They aren't check boxes. The reason this came up was either because it was breaking other javascript, or it was losing the state of the selected filter. Must have been because javascript wasn't being processed.

loon’s picture

Status: Needs review » Closed (outdated)

D6 reached its EOL, and there is no active release for D6 for this module anymore.
Development or support is not planned for D6. All D6-related issues are marked as outdated in a bunch.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.