MarkAHershberger has submitted this change and it was merged.

Change subject: Move reference to $row where it is in-scope and doesn't produce 
E_STRICT notices.
......................................................................


Move reference to $row where it is in-scope and doesn't produce
E_STRICT notices.

Bug: 57575
Change-Id: Ic508ebbb0816acd32be355b5f19b46637d58c36a
---
M maintenance/updateCollation.php
1 file changed, 5 insertions(+), 7 deletions(-)

Approvals:
  Chad: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/maintenance/updateCollation.php b/maintenance/updateCollation.php
index 964b313..7ca04b4 100644
--- a/maintenance/updateCollation.php
+++ b/maintenance/updateCollation.php
@@ -47,7 +47,7 @@
                $this->mDescription = <<<TEXT
 This script will find all rows in the categorylinks table whose collation is
 out-of-date (cl_collation != '$wgCategoryCollation') and repopulate cl_sortkey
-using the page title and cl_sortkey_prefix.  If everything's collation is
+using the page title and cl_sortkey_prefix.  If all collations are
 up-to-date, it will do nothing.
 TEXT;
 
@@ -188,13 +188,12 @@
                                                __METHOD__
                                        );
                                }
+                               if ( $row ) {
+                                       $batchConds = array( 
$this->getBatchCondition( $row, $dbw ) );
+                               }
                        }
                        if ( !$dryRun ) {
                                $dbw->commit( __METHOD__ );
-                       }
-
-                       if ( $row ) {
-                               $batchConds = array( $this->getBatchCondition( 
$row ) );
                        }
 
                        $count += $res->numRows();
@@ -219,8 +218,7 @@
         * Return an SQL expression selecting rows which sort above the given 
row,
         * assuming an ordering of cl_to, cl_type, cl_from
         */
-       function getBatchCondition( $row ) {
-               $dbw = $this->getDB( DB_MASTER );
+       function getBatchCondition( $row, $dbw ) {
                $fields = array( 'cl_to', 'cl_type', 'cl_from' );
                $first = true;
                $cond = false;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic508ebbb0816acd32be355b5f19b46637d58c36a
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: MarkAHershberger <[email protected]>
Gerrit-Reviewer: Aaron Schulz <[email protected]>
Gerrit-Reviewer: Chad <[email protected]>
Gerrit-Reviewer: MarkAHershberger <[email protected]>
Gerrit-Reviewer: Parent5446 <[email protected]>
Gerrit-Reviewer: jenkins-bot

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

Reply via email to