From c45d150b76beb89ad18195053688a0a0b45421c9 Mon Sep 17 00:00:00 2001 From: daniel Date: Tue, 15 May 2012 09:08:16 +0200 Subject: [PATCH] get deletion updates from content handler and hook --- docs/hooks.txt | 7 +++++++ includes/WikiPage.php | 7 ++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/docs/hooks.txt b/docs/hooks.txt index e7d536a9e4..405ee3d91d 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -2341,6 +2341,13 @@ One, and only one hook should set this, and return false. &$opts: Options to use for the query &$join: Join conditions +'WikiPageDeletionUpdates': manipulate the list of DataUpdates to be applied when + a page is deleted. Called in WikiPage::getDeletionUpdates(). + Note that updates specific to a content model should be provided by the + respective ContentHandler's getDeletionUpdates() method. +$page: the WikiPage +&$updates: the array of DataUpdate objects. Hook function may want to add to it. + 'wfShellWikiCmd': Called when generating a shell-escaped command line string to run a MediaWiki cli script. &$script: MediaWiki cli script path diff --git a/includes/WikiPage.php b/includes/WikiPage.php index 9755cf04d6..eaf32fe80f 100644 --- a/includes/WikiPage.php +++ b/includes/WikiPage.php @@ -3194,12 +3194,9 @@ class WikiPage extends Page { } public function getDeletionUpdates() { - $updates = array( - new LinksDeletionUpdate( $this ), - ); + $updates = $this->getContentHandler()->getDeletionUpdates( $this ); - //@todo: make a hook to add update objects - //NOTE: deletion updates will be determined by the ContentHandler in the future + wfRunHooks( 'WikiPageDeletionUpdates', array( $this, &$updates ) ); return $updates; } } -- 2.20.1