fix WikiPage::getDeletionUpdates() for cases where no content object is present.

Change-Id: Idbd8dd9a4f84f45acfe1a4388653990cf191a33b
This commit is contained in:
daniel 2012-07-24 17:51:28 +02:00
parent 3403216446
commit 086f719116
2 changed files with 8 additions and 3 deletions

View file

@ -2409,6 +2409,7 @@ One, and only one hook should set this, and return false.
Note that updates specific to a content model should be provided by the
respective Content's getDeletionUpdates() method.
$page: the WikiPage
$content: the Content to generate updates for
&$updates: the array of DataUpdate objects. Hook function may want to add to it.
'wfShellWikiCmd': Called when generating a shell-escaped command line

View file

@ -3188,7 +3188,7 @@ class WikiPage extends Page {
}
/**
* Returns a list of updates to be performed when this page is deleted. The updates should remove any infomration
* Returns a list of updates to be performed when this page is deleted. The updates should remove any information
* about this page from secondary data stores such as links tables.
*
* @param Content|null $content optional Content object for determining the necessary updates
@ -3201,9 +3201,13 @@ class WikiPage extends Page {
$content = $this->getContent( Revision::RAW );
}
$updates = $this->getContent()->getDeletionUpdates( $this->mTitle );
if ( !$content ) {
$updates = array();
} else {
$updates = $content->getDeletionUpdates( $this->mTitle );
}
wfRunHooks( 'WikiPageDeletionUpdates', array( $this, &$updates ) );
wfRunHooks( 'WikiPageDeletionUpdates', array( $this, $content, &$updates ) );
return $updates;
}