From f502988282d56577ef86bd54a3627231163cb23b Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Sun, 10 Apr 2011 21:11:39 +0000 Subject: [PATCH] * (bug 27712) add parent_id to list=deletedrevs --- RELEASE-NOTES | 1 + includes/api/ApiQueryDeletedrevs.php | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index fb8ad955ff..22b8231fc1 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -331,6 +331,7 @@ PHP if you have not done so prior to upgrading MediaWiki. * (bug 28364) add registration date to meta=userinfo * (bug 28254) action=paraminfo: Extract type from PARAM_DFLT if PARAM_TYPE is not set +* (bug 27712) add parent_id to list=deletedrevs === Languages updated in 1.18 === diff --git a/includes/api/ApiQueryDeletedrevs.php b/includes/api/ApiQueryDeletedrevs.php index 290f4d7b3f..c9775ef701 100644 --- a/includes/api/ApiQueryDeletedrevs.php +++ b/includes/api/ApiQueryDeletedrevs.php @@ -50,6 +50,7 @@ class ApiQueryDeletedrevs extends ApiQueryBase { $db = $this->getDB(); $params = $this->extractRequestParams( false ); $prop = array_flip( $params['prop'] ); + $fld_parentid = isset( $prop['parentid'] ); $fld_revid = isset( $prop['revid'] ); $fld_user = isset( $prop['user'] ); $fld_userid = isset( $prop['userid'] ); @@ -82,6 +83,10 @@ class ApiQueryDeletedrevs extends ApiQueryBase { $this->addTables( 'archive' ); $this->addWhere( 'ar_deleted = 0' ); $this->addFields( array( 'ar_title', 'ar_namespace', 'ar_timestamp' ) ); + + if ( $fld_parentid ) { + $this->addFields( 'ar_parent_id' ); + } if ( $fld_revid ) { $this->addFields( 'ar_rev_id' ); } @@ -203,6 +208,9 @@ class ApiQueryDeletedrevs extends ApiQueryBase { if ( $fld_revid ) { $rev['revid'] = intval( $row->ar_rev_id ); } + if ( $fld_parentid ) { + $rev['parentid'] = intval( $row->ar_parent_id ); + } if ( $fld_user ) { $rev['user'] = $row->ar_user_text; } @@ -297,6 +305,7 @@ class ApiQueryDeletedrevs extends ApiQueryBase { ApiBase::PARAM_DFLT => 'user|comment', ApiBase::PARAM_TYPE => array( 'revid', + 'parentid', 'user', 'userid', 'comment', @@ -322,6 +331,7 @@ class ApiQueryDeletedrevs extends ApiQueryBase { 'prop' => array( 'Which properties to get', ' revid - Adds the revision ID of the deleted revision', + ' parentid - Adds the revision ID of the previous revision to the page', ' user - Adds the user who made the revision', ' userid - Adds the user ID whom made the revision', ' comment - Adds the comment of the revision', -- 2.20.1