EBernhardson has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/223666

Change subject: Suppress interwiki results when they would break
......................................................................

Suppress interwiki results when they would break

Sometimes we end up with a SearchResults object that can't handle interwiki
results and it just isn't fair to try to feed them to it. It makes fatals.

There is another fix for this issue, but its more complex and as of yet
doesn't pass all the tests. But this is a simpler, more obvious fix we can
can use as a stopgap.

Bug: T104189
Change-Id: Id46545dd77a00ccd4ba2f18efc5d7d57f2d96626
(cherry picked from commit 037592809fc60a9f39f92a60f611811f507e077b)
---
M includes/CirrusSearch.php
M tests/jenkins/Jenkins.php
2 files changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CirrusSearch 
refs/changes/66/223666/1

diff --git a/includes/CirrusSearch.php b/includes/CirrusSearch.php
index f16c47e..5730852 100644
--- a/includes/CirrusSearch.php
+++ b/includes/CirrusSearch.php
@@ -149,7 +149,8 @@
                // Add interwiki results, if we have a sane result
                // Note that we have no way of sending warning back to the 
user.  In this case all warnings
                // are logged when they are added to the status object so we 
just ignore them here....
-               if ( $status->isOK() && $wgCirrusSearchInterwikiSources && 
$status->getValue() ) {
+               if ( $status->isOK() && $wgCirrusSearchInterwikiSources && 
$status->getValue() &&
+                               method_exists( $status->getValue(), 
'addInterwikiResults' ) ) {
                        // @todo @fixme: This should absolutely be a 
multisearch. I knew this when I
                        // wrote the code but Searcher needs some refactoring 
first.
                        foreach ( $wgCirrusSearchInterwikiSources as $interwiki 
=> $index ) {
diff --git a/tests/jenkins/Jenkins.php b/tests/jenkins/Jenkins.php
index f75783c..fb4a393 100644
--- a/tests/jenkins/Jenkins.php
+++ b/tests/jenkins/Jenkins.php
@@ -79,6 +79,7 @@
 $wgCirrusSearchLanguageWeight[ 'user' ] = 10.0;
 $wgCirrusSearchLanguageWeight[ 'wiki' ] = 5.0;
 $wgCirrusSearchAllowLeadingWildcard = false;
+// $wgCirrusSearchInterwikiSources[ 'c' ] = 'commonswiki';
 
 class Jenkins {
        /**

-- 
To view, visit https://gerrit.wikimedia.org/r/223666
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id46545dd77a00ccd4ba2f18efc5d7d57f2d96626
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: wmf/1.26wmf13
Gerrit-Owner: EBernhardson <[email protected]>
Gerrit-Reviewer: Manybubbles <[email protected]>

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

Reply via email to