Index: trunk/extensions/Renameuser/renameUserCleanup.php |
— | — | @@ -100,10 +100,10 @@ |
101 | 101 | public function updateTable($table,$usernamefield,$useridfield,$timestampfield,$olduser,$newuser,$dbw) { |
102 | 102 | $doUid = 0; |
103 | 103 | |
104 | | - $contribs = $dbw->selectField( $table, 'count(*)', |
| 104 | + $contribs = $dbw->selectField( $table, 'count(*)', |
105 | 105 | array( $usernamefield => $olduser->getName(), $useridfield => $newuser->getId() ), __METHOD__ ); |
106 | 106 | if ($contribs == 0) { |
107 | | - $contribs = $dbw->selectField( $table, 'count(*)', |
| 107 | + $contribs = $dbw->selectField( $table, 'count(*)', |
108 | 108 | array( $usernamefield => $olduser->getName(), $useridfield => 0 ), __METHOD__ ); |
109 | 109 | if ($contribs > 0) { |
110 | 110 | print("Found $contribs edits to be re-attributed from table $table but the uid present is 0 (should be ".$newuser->getId().")\n"); |
— | — | @@ -155,11 +155,11 @@ |
156 | 156 | return(0); |
157 | 157 | } |
158 | 158 | $dbw->begin(); |
159 | | - $result = $dbw->select( $table, $timestampfield, $selectConds , __METHOD__, |
| 159 | + $result = $dbw->select( $table, $timestampfield, $selectConds , __METHOD__, |
160 | 160 | array( 'ORDER BY' => $timestampfield.' DESC', 'LIMIT' => self::BATCH_SIZE ) ); |
161 | 161 | if (! $result) { |
162 | 162 | print("There were rows for updating but now they are gone. Skipping.\n"); |
163 | | - $db->rollback(); |
| 163 | + $dbw->rollback(); |
164 | 164 | return(0); |
165 | 165 | } |
166 | 166 | $result->seek($result->numRows() -1 ); |
— | — | @@ -173,10 +173,10 @@ |
174 | 174 | } |
175 | 175 | else { |
176 | 176 | print("problem with the update, rolling back and exiting\n"); |
177 | | - $db->rollback(); |
| 177 | + $dbw->rollback(); |
178 | 178 | exit(1); |
179 | 179 | } |
180 | | - $contribs = User::edits( $olduser->getId() ); |
| 180 | + //$contribs = User::edits( $olduser->getId() ); |
181 | 181 | $contribs = $dbw->selectField( $table, 'count(*)', $selectConds, __METHOD__ ); |
182 | 182 | print("updated $rowsDone edits; $contribs edits remaining to be re-attributed\n"); |
183 | 183 | } |