lucene-solr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geir Ove Grønmo (JIRA) <j...@apache.org>
Subject [jira] Created: (SOLR-1403) solrjs broken when used with Prototype library
Date Wed, 02 Sep 2009 11:10:32 GMT
solrjs broken when used with Prototype library
----------------------------------------------

                 Key: SOLR-1403
                 URL: https://issues.apache.org/jira/browse/SOLR-1403
             Project: Solr
          Issue Type: Bug
    Affects Versions: 1.4
            Reporter: Geir Ove Grønmo


Using the Prototype javascript library in the same page as the SolrJS javascript library does
not work. It triggers the following error:

stacktrace:   Line 303 of linked script http://localhost:8080/ontopoly/solr/solrjs-1.4-dev.js
    	  	this.widgets[id].doRequest(query, start, resultsOnly);
  ...

The problem is that Prototype redefines the each function in the Array class. And that does
not work with the for-in loop syntax in javascript.

The fix is to change the widgets and selectionViews arrays defined in jQuery.solrjs.Manager
from arrays to proper associative arrays:

  widgets : {},
  ...
  selectionViews : {},

>From what I can see these two properties are supposed to be proper associative arrays
anyway, and not arrays with string keys.

More background on this problem can be found here: http://andrewdupont.net/2006/05/18/javascript-associative-arrays-considered-harmful/


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message