Item11505: Javascript Error on JQuery 1.7.1

pencil
Priority: Normal
Current State: Closed
Released In: n/a
Target Release:
Applies To: Extension
Component: SolrPlugin
Branches: trunk
Reported By: OliverSchaub
Waiting For:
Last Change By: MichaelDaum
The Result-Page of Solr throws the following Javascript-Error when using JQuery 1.7.1:

Uncaught Error: Syntax error, unrecognized expression: [name^=foswiki.SolrPlugin.mapping]

Changing the Selector inside solrplugin.js from
[name^=foswiki.SolrPlugin.mapping]
to
[name^='foswiki.SolrPlugin.mapping']

solves this Problem.

-- OliverSchaub - 06 Feb 2012

Just noticed even more problems with Solr and JQuery 1.7.1:

Facets and filters don't do anything anymore when clicked. This is the Error thrown when a "Date-Filter" or a "Web-Filter" is clicked:
Syntax error, unrecognized expression: [value=date:[NOW-1HOUR TO NOW]]
Syntax error, unrecognized expression: [value=web:LOG]

Looks like the same Issue as in the Error above. It seems that values need to be in quotes.

-- OliverSchaub - 09 Feb 2012

Ok, here is the complete fix (solrplugin.js):
@@ 38,5
- $("meta[name^=foswiki.SolrPlugin.mapping]").each(function() {
+ $("meta[name^='foswiki.SolrPlugin.mapping']").each(function() {

@@ 171,7
- $(".solrFacetValue[value="+fv.facet+":"+fv.value+"]").addClass("current").filter("input").attr('checked', 'checked');
+ $(".solrFacetValue[value='"+fv.facet+":"+fv.value+"']").addClass("current").filter("input").attr('checked', 'checked');

@@ 208,7
- $(".solrFacetValue[value="+fv.facet+":"+fv.value+"]").removeClass("current").filter("input").removeAttr('checked');
+ $(".solrFacetValue[value='"+fv.facet+":"+fv.value+"']").removeClass("current").filter("input").removeAttr('checked');

@@ 422,9
-  $(".solrDeleteFacetValue[value="+$this.val()+"]").removeAttr("checked");
+  $(".solrDeleteFacetValue[value='"+$this.val()+"']").removeAttr("checked");

Just put all the values in quotes. (single quotes in this case)

-- OliverSchaub - 09 Feb 2012

Hm, this was already fixed in some previous changeset...

-- MichaelDaum - 24 Feb 2012
 

ItemTemplate edit

Summary Javascript Error on JQuery 1.7.1
ReportedBy OliverSchaub
Codebase 1.1.4
SVN Range
AppliesTo Extension
Component SolrPlugin
Priority Normal
CurrentState Closed
WaitingFor
Checkins SolrPlugin:f17183f78fd8
ReleasedIn n/a
CheckinsOnBranches trunk
trunkCheckins SolrPlugin:f17183f78fd8
Release01x01Checkins
Topic revision: r5 - 24 Feb 2012, MichaelDaum
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy