From: Jesús Martínez Novo Date: Mon, 22 Apr 2019 09:21:52 +0000 (+0200) Subject: ExternalStore: Pass external domain to getReadOnlyReason X-Git-Tag: 1.34.0-rc.0~1628 X-Git-Url: http://git.cyclocoop.org/%22.%20generer_url_ecrire%28%22sites_tous%22%2C%22%22%29.%20%22?a=commitdiff_plain;h=df6100e0cc069451913479483f3773532a60ffae;p=lhc%2Fweb%2Fwiklou.git ExternalStore: Pass external domain to getReadOnlyReason Be consistent with other paths of code that supply the external domain id to LoadBalancer instead of defaulting to the wiki's domain. This was causing the getReadOnlyReason to fail because it tries to connect to the local wiki database using external storage credentials. Bug: T200471 Change-Id: Ie73ea931d5c93f967624ee67717f87c2d9a31559 --- diff --git a/includes/externalstore/ExternalStoreDB.php b/includes/externalstore/ExternalStoreDB.php index 4164505822..cac16b6a90 100644 --- a/includes/externalstore/ExternalStoreDB.php +++ b/includes/externalstore/ExternalStoreDB.php @@ -106,7 +106,9 @@ class ExternalStoreDB extends ExternalStoreMedium { } public function isReadOnly( $location ) { - return ( $this->getLoadBalancer( $location )->getReadOnlyReason() !== false ); + $lb = $this->getLoadBalancer( $location ); + $domainId = $this->getDomainId( $lb->getServerInfo( $lb->getWriterIndex() ) ); + return ( $lb->getReadOnlyReason( $domainId ) !== false ); } /**