Index: trunk/phase3/maintenance/namespaceDupes.php |
— | — | @@ -132,6 +132,7 @@ |
133 | 133 | |
134 | 134 | /** |
135 | 135 | * Get the interwiki list |
| 136 | + * @todo Needs to respect interwiki cache! |
136 | 137 | * @return array |
137 | 138 | */ |
138 | 139 | private function getInterwikiList() { |
— | — | @@ -280,9 +281,9 @@ |
281 | 282 | } |
282 | 283 | $this->output( "... *** using suffixed form [[" . $title->getPrefixedText() . "]] ***\n" ); |
283 | 284 | } |
284 | | - $tables = array( 'page' ); |
| 285 | + $tables = array( 'page' => 'page' ); |
285 | 286 | foreach( $tables as $table ) { |
286 | | - $this->resolveConflictOn( $row, $table ); |
| 287 | + $this->resolveConflictOn( $row, $table, $prefix ); |
287 | 288 | } |
288 | 289 | return true; |
289 | 290 | } |
— | — | @@ -291,18 +292,19 @@ |
292 | 293 | * Resolve a given conflict |
293 | 294 | * @param $row Row from the old broken entry |
294 | 295 | * @param $table String Table to update |
| 296 | + * @param $prefix String Prefix for column name, like page or ar |
295 | 297 | */ |
296 | | - private function resolveConflictOn( $row, $table ) { |
| 298 | + private function resolveConflictOn( $row, $table, $prefix ) { |
297 | 299 | $this->output( "... resolving on $table... " ); |
298 | 300 | $newTitle = Title::makeTitleSafe( $row->namespace, $row->title ); |
299 | 301 | $this->db->update( $table, |
300 | 302 | array( |
301 | | - "{$table}_namespace" => $newTitle->getNamespace(), |
302 | | - "{$table}_title" => $newTitle->getDBkey(), |
| 303 | + "{$prefix}_namespace" => $newTitle->getNamespace(), |
| 304 | + "{$prefix}_title" => $newTitle->getDBkey(), |
303 | 305 | ), |
304 | 306 | array( |
305 | | - "{$table}_namespace" => 0, |
306 | | - "{$table}_title" => $row->oldtitle, |
| 307 | + "{$prefix}_namespace" => 0, |
| 308 | + "{$prefix}_title" => $row->oldtitle, |
307 | 309 | ), |
308 | 310 | __METHOD__ ); |
309 | 311 | $this->output( "ok.\n" ); |