Index: trunk/phase3/includes/Title.php |
— | — | @@ -3091,13 +3091,16 @@ |
3092 | 3092 | } |
3093 | 3093 | } |
3094 | 3094 | |
3095 | | - $pageid = $this->getArticleID(); |
| 3095 | + $dbw->begin(); # If $file was a LocalFile, its transaction would have closed our own. |
| 3096 | + $pageid = $this->getArticleID( GAID_FOR_UPDATE ); |
3096 | 3097 | $protected = $this->isProtected(); |
3097 | 3098 | $pageCountChange = ( $createRedirect ? 1 : 0 ) - ( $nt->exists() ? 1 : 0 ); |
3098 | 3099 | |
3099 | 3100 | // Do the actual move |
3100 | 3101 | $err = $this->moveToInternal( $nt, $reason, $createRedirect ); |
3101 | 3102 | if ( is_array( $err ) ) { |
| 3103 | + # FIXME: What about the File we have already moved? |
| 3104 | + $dbw->rollback(); |
3102 | 3105 | return $err; |
3103 | 3106 | } |
3104 | 3107 | |
— | — | @@ -3166,6 +3169,8 @@ |
3167 | 3170 | $u = new SearchUpdate( $redirid, $this->getPrefixedDBkey(), '' ); |
3168 | 3171 | $u->doUpdate(); |
3169 | 3172 | |
| 3173 | + $dbw->commit(); |
| 3174 | + |
3170 | 3175 | # Update site_stats |
3171 | 3176 | if ( $this->isContentPage() && !$nt->isContentPage() ) { |
3172 | 3177 | # No longer a content page |
— | — | @@ -3320,7 +3325,7 @@ |
3321 | 3326 | $redirectSuppressed = false; |
3322 | 3327 | } else { |
3323 | 3328 | // Get rid of old new page entries in Special:NewPages and RC. |
3324 | | - // Needs to be before $this->resetArticleUD( 0 ). |
| 3329 | + // Needs to be before $this->resetArticleID( 0 ). |
3325 | 3330 | $dbw->delete( 'recentchanges', array( |
3326 | 3331 | 'rc_timestamp' => $dbw->timestamp( $this->getEarliestRevTime() ), |
3327 | 3332 | 'rc_namespace' => $oldns, |