MaxSem has uploaded a new change for review.

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

Change subject: Fix fatal
......................................................................

Fix fatal

Bug: T149159
Change-Id: Ie70878b3c2cefb5d29371571126cfdbb431823fb
---
M includes/Searcher.php
1 file changed, 16 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/GeoData 
refs/changes/36/318136/1

diff --git a/includes/Searcher.php b/includes/Searcher.php
index 02d5594..8642325 100644
--- a/includes/Searcher.php
+++ b/includes/Searcher.php
@@ -36,13 +36,8 @@
                $pageType = $this->connection->getPageType( wfWikiID(), 
$indexType );
                $search = $pageType->createSearch( $query );
 
-               $log = new SearchRequestLog(
-                       $this->connection->getClient(),
-                       $this->user,
-                       'performing {queryType}',
-                       $queryType
-               );
                try {
+                       $log = $this->newLog( 'performing {queryType}', 
$queryType );
                        $this->start( $log );
                        $result = $search->search();
                        $this->success();
@@ -53,4 +48,19 @@
 
                return $result;
        }
+
+       /**
+        * @param string $description
+        * @param string $queryType
+        * @param string[] $extra
+        * @return SearchRequestLog
+        */
+       protected function newLog( $description, $queryType, array $extra = [] 
) {
+               return new SearchRequestLog(
+                       $this->connection->getClient(),
+                       $description,
+                       $queryType,
+                       $extra
+               );
+       }
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie70878b3c2cefb5d29371571126cfdbb431823fb
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/GeoData
Gerrit-Branch: master
Gerrit-Owner: MaxSem <[email protected]>

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

Reply via email to