un-deprecate WikiPage::getAutoDeleteReason
authordaniel <daniel.kinzler@wikimedia.de>
Wed, 13 Jun 2012 10:00:28 +0000 (12:00 +0200)
committerdaniel <daniel.kinzler@wikimedia.de>
Wed, 13 Jun 2012 10:00:28 +0000 (12:00 +0200)
includes/WikiPage.php
includes/api/ApiDelete.php

index 5a8f5e6..afe5c00 100644 (file)
@@ -2869,6 +2869,7 @@ class WikiPage extends Page {
        * @param $newtext String|null: The submitted text of the page.
        * @param $flags Int bitmask: a bitmask of flags submitted for the edit.
        * @return string An appropriate autosummary, or an empty string.
+       *
        * @deprecated since 1.WD, use ContentHandler::getAutosummary() instead
        */
        public static function getAutosummary( $oldtext, $newtext, $flags ) {
@@ -2889,15 +2890,9 @@ class WikiPage extends Page {
         * @param &$hasHistory Boolean: whether the page has a history
         * @return mixed String containing deletion reason or empty string, or boolean false
         *    if no revision occurred
-        * @deprecated since 1.WD, use ContentHandler::getAutoDeleteReason() instead
         */
        public function getAutoDeleteReason( &$hasHistory ) {
-               #NOTE: stub for backwards-compatibility.
-
-               wfDeprecated( __METHOD__, '1.WD' );
-
-               $handler = ContentHandler::getForTitle( $this->getTitle() );
-               return $handler->getAutoDeleteReason( $this->getTitle(), $hasHistory );
+               return $this->getContentHandler()->getAutoDeleteReason( $this->getTitle(), $hasHistory );
        }
 
        /**
index 121cb48..c2a8a42 100644 (file)
@@ -111,7 +111,7 @@ class ApiDelete extends ApiBase {
                        // Need to pass a throwaway variable because generateReason expects
                        // a reference
                        $hasHistory = false;
-                       $reason = $page->getAutoDeleteReason( $hasHistory ); #FIXME: use ContentHandler::getAutoDeleteReason()
+                       $reason = $page->getAutoDeleteReason( $hasHistory ); 
                        if ( $reason === false ) {
                                return array( array( 'cannotdelete', $title->getPrefixedText() ) );
                        }