20after4 has uploaded a new change for review.

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

Change subject: Invoke database connection in ApiQueryGlobalBlocks::execute
......................................................................

Invoke database connection in ApiQueryGlobalBlocks::execute

This fixes the following error:
Exception Caught: Call to a member function buildLike() on a non-object (null)"

This is a follow-up of commit 53dee904.

Bug: T149232
Change-Id: Ia29c7b7ad6dcf335a092863f703ede12dd072dbe
---
M includes/api/ApiQueryGlobalBlocks.php
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/GlobalBlocking 
refs/changes/60/318160/1

diff --git a/includes/api/ApiQueryGlobalBlocks.php 
b/includes/api/ApiQueryGlobalBlocks.php
index ede610e..a7231ba 100644
--- a/includes/api/ApiQueryGlobalBlocks.php
+++ b/includes/api/ApiQueryGlobalBlocks.php
@@ -94,6 +94,7 @@
                                $lower = $upper = IP::toHex( $params['ip'] );
                        }
                        $prefix = substr( $lower, 0, 4 );
+                       $dbr = GlobalBlocking::getGlobalBlockingDatabase( 
DB_SLAVE );
                        $this->addWhere( [
                                        'gb_range_start ' . $dbr->buildLike( 
$prefix, $dbr->anyString() ),
                                        'gb_range_start <= ' . $dbr->addQuotes( 
$lower ),

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia29c7b7ad6dcf335a092863f703ede12dd072dbe
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/GlobalBlocking
Gerrit-Branch: wmf/1.28.0-wmf.23
Gerrit-Owner: 20after4 <mmod...@wikimedia.org>
Gerrit-Reviewer: Dereckson <dereck...@espace-win.org>

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

Reply via email to