http://www.mediawiki.org/wiki/Special:Code/MediaWiki/94998

Revision: 94998
Author:   jeroendedauw
Date:     2011-08-19 14:35:00 +0000 (Fri, 19 Aug 2011)
Log Message:
-----------
fix bug 30459

Modified Paths:
--------------
    trunk/extensions/SemanticMediaWiki/includes/SMW_QueryProcessor.php

Modified: trunk/extensions/SemanticMediaWiki/includes/SMW_QueryProcessor.php
===================================================================
--- trunk/extensions/SemanticMediaWiki/includes/SMW_QueryProcessor.php  
2011-08-19 14:05:00 UTC (rev 94997)
+++ trunk/extensions/SemanticMediaWiki/includes/SMW_QueryProcessor.php  
2011-08-19 14:35:00 UTC (rev 94998)
@@ -307,16 +307,24 @@
 
                        return $result;
                } else { // result for counting or debugging is just a string
-                       if ( array_key_exists( 'intro', $params ) ) {
-                               $res = str_replace( '_', ' ', $params['intro'] 
) . $res;
+                       if ( is_string( $res ) ) {
+                               if ( array_key_exists( 'intro', $params ) ) {
+                                       $res = str_replace( '_', ' ', 
$params['intro'] ) . $res;
+                               }
+                               if ( array_key_exists( 'outro', $params ) ) {
+                                       $res .= str_replace( '_', ' ', 
$params['outro'] );
+                               }
+                               
+                               $result = $res . smwfEncodeMessages( 
$query->getErrors() );
                        }
-                       if ( array_key_exists( 'outro', $params ) ) {
-                               $res .= str_replace( '_', ' ', $params['outro'] 
);
+                       else {
+                               // When no valid result was obtained, $res will 
be a SMWQueryResult.
+                               $result = smwfEncodeMessages( 
$query->getErrors() );
                        }
-
+                       
                        wfProfileOut( 'SMWQueryProcessor::getResultFromQuery 
(SMW)' );
-
-                       return $res . smwfEncodeMessages( $query->getErrors() );
+                       
+                       return $result;
                }
        }
 


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to