From 7a6ce6c2d879af2105985dc7d4c32b1a67e0289c Mon Sep 17 00:00:00 2001 From: daniel Date: Wed, 13 Jun 2012 12:00:28 +0200 Subject: [PATCH] un-deprecate WikiPage::getAutoDeleteReason --- includes/WikiPage.php | 9 ++------- includes/api/ApiDelete.php | 2 +- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/includes/WikiPage.php b/includes/WikiPage.php index 5a8f5e6824..afe5c0009b 100644 --- a/includes/WikiPage.php +++ b/includes/WikiPage.php @@ -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 ); } /** diff --git a/includes/api/ApiDelete.php b/includes/api/ApiDelete.php index 121cb481b2..c2a8a429d5 100644 --- a/includes/api/ApiDelete.php +++ b/includes/api/ApiDelete.php @@ -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() ) ); } -- 2.20.1