From 1fb9118c7cdc54cf4e4f2af727bf37f32c69319b Mon Sep 17 00:00:00 2001 From: Rob Moen Date: Thu, 15 May 2014 15:51:52 -0700 Subject: [PATCH] Pass archived page id to ArticleUndelete hook. Needed for instrumentation of PageRestoration schema Rationale: By the time the hook runs, there is no longer record of the previous page id. Change-Id: If87a73e47def7a4404858f374780c3f1cf4d69b5 See: https://meta.wikimedia.org/wiki/Schema:PageRestoration Needed by: Id40347ec268658dc854e4ab2dd38570b19db1477 --- includes/specials/SpecialUndelete.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/includes/specials/SpecialUndelete.php b/includes/specials/SpecialUndelete.php index 6d6b2c1c09..51235ee502 100644 --- a/includes/specials/SpecialUndelete.php +++ b/includes/specials/SpecialUndelete.php @@ -550,6 +550,7 @@ class PageArchive { $ret->seek( $rev_count - 1 ); // move to last $row = $ret->fetchObject(); // get newest archived rev + $oldPageId = (int)$row->ar_page_id; // pass this to ArticleUndelete hook $ret->seek( 0 ); // move back // grab the content to check consistency with global state before restoring the page. @@ -642,7 +643,7 @@ class PageArchive { ); } - wfRunHooks( 'ArticleUndelete', array( &$this->title, $created, $comment ) ); + wfRunHooks( 'ArticleUndelete', array( &$this->title, $created, $comment, $oldPageId ) ); if ( $this->title->getNamespace() == NS_FILE ) { $update = new HTMLCacheUpdate( $this->title, 'imagelinks' ); -- 2.20.1