Smalyshev has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/401826 )

Change subject: Do not throw if request was performed by other engine.
......................................................................

Do not throw if request was performed by other engine.

This could happen if CirrusSearch extension is enabled, but the
search engine configuration ($wgSearchType) selects other engine.

In this case, we should not throw exceptions but should just ignore
the results.

Change-Id: I84a5fc717a0e811d9cb18f8bea86daa8e977b7d4
---
M includes/ElasticsearchIntermediary.php
1 file changed, 3 insertions(+), 1 deletion(-)


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

diff --git a/includes/ElasticsearchIntermediary.php 
b/includes/ElasticsearchIntermediary.php
index ab67f91..0521f9c 100644
--- a/includes/ElasticsearchIntermediary.php
+++ b/includes/ElasticsearchIntermediary.php
@@ -108,7 +108,9 @@
         */
        public static function setResultPages( array $matches ) {
                if ( self::$requestLogger === null ) {
-                       throw new \RuntimeException( 'No search request was 
made' );
+                       // This could happen if Cirrus is not the active engine,
+                       // but the hook is still loaded. In this case, do 
nothing.
+                       return;
                } else {
                        self::$requestLogger->setResultPages( $matches );
                }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I84a5fc717a0e811d9cb18f8bea86daa8e977b7d4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: master
Gerrit-Owner: Smalyshev <smalys...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to