public function execute() {
$params = $this->extractRequestParams();
- $titleObj = $this->getTitleOrPageId( $params );
- $pageObj = WikiPage::factory( $titleObj );
- $pageObj->loadPageData( 'fromdbmaster' );
+ $pageObj = $this->getTitleOrPageId( $params, 'fromdbmaster' );
if ( !$pageObj->exists() ) {
$this->dieUsageMsg( 'notanarticle' );
}
+ $titleObj = $pageObj->getTitle();
$reason = ( isset( $params['reason'] ) ? $params['reason'] : null );
$user = $this->getUser();
// Need to pass a throwaway variable because generateReason expects
// a reference
$hasHistory = false;
- $reason = $page->getAutoDeleteReason( $hasHistory );
+ $reason = $page->getAutoDeleteReason( $hasHistory ); #FIXME: use ContentHandler::getAutoDeleteReason()
if ( $reason === false ) {
return array( array( 'cannotdelete', $title->getPrefixedText() ) );
}