Robmoen has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/133631

Change subject: Pass archived page id to ArticleUndelete hook.
......................................................................

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
Dependency: (will update)
---
M includes/specials/SpecialUndelete.php
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/31/133631/1

diff --git a/includes/specials/SpecialUndelete.php 
b/includes/specials/SpecialUndelete.php
index 6d6b2c1..6089a8f 100644
--- a/includes/specials/SpecialUndelete.php
+++ b/includes/specials/SpecialUndelete.php
@@ -550,6 +550,7 @@
 
                $ret->seek( $rev_count - 1 ); // move to last
                $row = $ret->fetchObject(); // get newest archived rev
+               $oldPageId = $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 @@
                        );
                }
 
-               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' );

-- 
To view, visit https://gerrit.wikimedia.org/r/133631
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If87a73e47def7a4404858f374780c3f1cf4d69b5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Robmoen <rm...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to