https://www.mediawiki.org/wiki/Special:Code/MediaWiki/102973

Revision: 102973
Author:   ialex
Date:     2011-11-14 12:40:14 +0000 (Mon, 14 Nov 2011)
Log Message:
-----------
Updated remaining functions executing NewRevisionFromEditComplete hook to use 
WikiPage instead of Article

Modified Paths:
--------------
    trunk/phase3/includes/filerepo/LocalFile.php
    trunk/phase3/includes/specials/SpecialImport.php

Modified: trunk/phase3/includes/filerepo/LocalFile.php
===================================================================
--- trunk/phase3/includes/filerepo/LocalFile.php        2011-11-14 12:22:07 UTC 
(rev 102972)
+++ trunk/phase3/includes/filerepo/LocalFile.php        2011-11-14 12:40:14 UTC 
(rev 102973)
@@ -1051,8 +1051,7 @@
                }
 
                $descTitle = $this->getTitle();
-               $article = new ImagePage( $descTitle );
-               $article->setFile( $this );
+               $wikiPage = WikiPage::factory( $descTitle );
 
                # Add the log entry
                $log = new LogPage( 'upload' );
@@ -1071,8 +1070,8 @@
                        if (!is_null($nullRevision)) {
                                $nullRevision->insertOn( $dbw );
 
-                               wfRunHooks( 'NewRevisionFromEditComplete', 
array( $article, $nullRevision, $latest, $user ) );
-                               $article->updateRevisionOn( $dbw, $nullRevision 
);
+                               wfRunHooks( 'NewRevisionFromEditComplete', 
array( $wikiPage, $nullRevision, $latest, $user ) );
+                               $wikiPage->updateRevisionOn( $dbw, 
$nullRevision );
                        }
                        # Invalidate the cache for the description page
                        $descTitle->invalidateCache();
@@ -1081,7 +1080,7 @@
                        # New file; create the description page.
                        # There's already a log entry, so don't make a second 
RC entry
                        # Squid and file cache for the description page are 
purged by doEdit.
-                       $article->doEdit( $pageText, $comment, EDIT_NEW | 
EDIT_SUPPRESS_RC );
+                       $wikiPage->doEdit( $pageText, $comment, EDIT_NEW | 
EDIT_SUPPRESS_RC );
                }
 
                # Commit the transaction now, in case something goes wrong later

Modified: trunk/phase3/includes/specials/SpecialImport.php
===================================================================
--- trunk/phase3/includes/specials/SpecialImport.php    2011-11-14 12:22:07 UTC 
(rev 102972)
+++ trunk/phase3/includes/specials/SpecialImport.php    2011-11-14 12:40:14 UTC 
(rev 102973)
@@ -390,10 +390,10 @@
                        $nullRevision = Revision::newNullRevision( $dbw, 
$title->getArticleId(), $comment, true );
                        if (!is_null($nullRevision)) {
                                $nullRevision->insertOn( $dbw );
-                               $article = new Article( $title );
+                               $page = WikiPage::factory( $title );
                                # Update page record
-                               $article->updateRevisionOn( $dbw, $nullRevision 
);
-                               wfRunHooks( 'NewRevisionFromEditComplete', 
array( $article, $nullRevision, $latest, $this->getUser() ) );
+                               $page->updateRevisionOn( $dbw, $nullRevision );
+                               wfRunHooks( 'NewRevisionFromEditComplete', 
array( $page, $nullRevision, $latest, $this->getUser() ) );
                        }
                } else {
                        $this->getOutput()->addHTML( "<li>" . 
Linker::linkKnown( $title ) . " " .


_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to