Index: trunk/phase3/includes/filerepo/LocalFile.php |
— | — | @@ -1051,8 +1051,7 @@ |
1052 | 1052 | } |
1053 | 1053 | |
1054 | 1054 | $descTitle = $this->getTitle(); |
1055 | | - $article = new ImagePage( $descTitle ); |
1056 | | - $article->setFile( $this ); |
| 1055 | + $wikiPage = WikiPage::factory( $descTitle ); |
1057 | 1056 | |
1058 | 1057 | # Add the log entry |
1059 | 1058 | $log = new LogPage( 'upload' ); |
— | — | @@ -1071,8 +1070,8 @@ |
1072 | 1071 | if (!is_null($nullRevision)) { |
1073 | 1072 | $nullRevision->insertOn( $dbw ); |
1074 | 1073 | |
1075 | | - wfRunHooks( 'NewRevisionFromEditComplete', array( $article, $nullRevision, $latest, $user ) ); |
1076 | | - $article->updateRevisionOn( $dbw, $nullRevision ); |
| 1074 | + wfRunHooks( 'NewRevisionFromEditComplete', array( $wikiPage, $nullRevision, $latest, $user ) ); |
| 1075 | + $wikiPage->updateRevisionOn( $dbw, $nullRevision ); |
1077 | 1076 | } |
1078 | 1077 | # Invalidate the cache for the description page |
1079 | 1078 | $descTitle->invalidateCache(); |
— | — | @@ -1081,7 +1080,7 @@ |
1082 | 1081 | # New file; create the description page. |
1083 | 1082 | # There's already a log entry, so don't make a second RC entry |
1084 | 1083 | # Squid and file cache for the description page are purged by doEdit. |
1085 | | - $article->doEdit( $pageText, $comment, EDIT_NEW | EDIT_SUPPRESS_RC ); |
| 1084 | + $wikiPage->doEdit( $pageText, $comment, EDIT_NEW | EDIT_SUPPRESS_RC ); |
1086 | 1085 | } |
1087 | 1086 | |
1088 | 1087 | # Commit the transaction now, in case something goes wrong later |
Index: trunk/phase3/includes/specials/SpecialImport.php |
— | — | @@ -390,10 +390,10 @@ |
391 | 391 | $nullRevision = Revision::newNullRevision( $dbw, $title->getArticleId(), $comment, true ); |
392 | 392 | if (!is_null($nullRevision)) { |
393 | 393 | $nullRevision->insertOn( $dbw ); |
394 | | - $article = new Article( $title ); |
| 394 | + $page = WikiPage::factory( $title ); |
395 | 395 | # Update page record |
396 | | - $article->updateRevisionOn( $dbw, $nullRevision ); |
397 | | - wfRunHooks( 'NewRevisionFromEditComplete', array( $article, $nullRevision, $latest, $this->getUser() ) ); |
| 396 | + $page->updateRevisionOn( $dbw, $nullRevision ); |
| 397 | + wfRunHooks( 'NewRevisionFromEditComplete', array( $page, $nullRevision, $latest, $this->getUser() ) ); |
398 | 398 | } |
399 | 399 | } else { |
400 | 400 | $this->getOutput()->addHTML( "<li>" . Linker::linkKnown( $title ) . " " . |