r109043 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r109042‎ | r109043 | r109044 >
Date:15:54, 16 January 2012
Author:sbachenberg
Status:deferred (Comments)
Tags:
Comment:
Fixed a Bug in the findField Function, but now we need some new Exception Handling. If you now try to Search a Text in a nummeric Field it crashes.
Modified paths:
  • /trunk/extensions/SolrStore/SolrTalker.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SolrStore/SolrTalker.php
@@ -98,6 +98,7 @@
9999 $dynamicBase = substr( $field->str[2], 1 ); // Get the dynamic base of the field eg. "*_dtmax"
100100 $newField = str_replace( $dynamicBase, '', $field['name'] ); // Get the field name without the dynamicbase
101101 if ( strcasecmp( str_replace( ' ', '_', $newField ), $searchField ) == 0 ) { // Replace all spaces with underscore for better matching
 102+ $result = trim($field['name']);
102103 if ( stripos( $dynamicBase, 'max' ) && stripos( $sort, 'desc' ) ) {
103104 // For descending sorting use the MaX value field
104105 continue 2; // we got the right field, stop it!

Comments

#Comment by SBachenberg (talk | contribs)   16:16, 16 January 2012

You can Test the new Error if you want: http://svbosofixwiki/sofiswiki/index.php?title=Spezial%3ASolrSearch%2FProjekte&solrTitel=&solrPersonen=&solrid=Money

And reproduce it if you write any text in the ADIS-ID Field: http://gesis.org/sofiswiki/index.php?title=Spezial%3ASolrSearch%2FProjekte

The Error occurs because Adis-ID is a Nummeric Field.

#Comment by Jeroen De Dauw (talk | contribs)   16:47, 16 January 2012

You're missing some spaces :)

trim( $field['name'] );

#Comment by SBachenberg (talk | contribs)   17:02, 16 January 2012

Do you have a Netbeans Template for Mediawiki Code Style ?

Status & tagging log