r85770 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r85769‎ | r85770 | r85771 >
Date:21:11, 10 April 2011
Author:reedy
Status:ok (Comments)
Tags:
Comment:
* (bug 27712) add parent_id to list=deletedrevs
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryDeletedrevs.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQueryDeletedrevs.php
@@ -50,6 +50,7 @@
5151 $db = $this->getDB();
5252 $params = $this->extractRequestParams( false );
5353 $prop = array_flip( $params['prop'] );
 54+ $fld_parentid = isset( $prop['parentid'] );
5455 $fld_revid = isset( $prop['revid'] );
5556 $fld_user = isset( $prop['user'] );
5657 $fld_userid = isset( $prop['userid'] );
@@ -82,6 +83,10 @@
8384 $this->addTables( 'archive' );
8485 $this->addWhere( 'ar_deleted = 0' );
8586 $this->addFields( array( 'ar_title', 'ar_namespace', 'ar_timestamp' ) );
 87+
 88+ if ( $fld_parentid ) {
 89+ $this->addFields( 'ar_parent_id' );
 90+ }
8691 if ( $fld_revid ) {
8792 $this->addFields( 'ar_rev_id' );
8893 }
@@ -203,6 +208,9 @@
204209 if ( $fld_revid ) {
205210 $rev['revid'] = intval( $row->ar_rev_id );
206211 }
 212+ if ( $fld_parentid ) {
 213+ $rev['parentid'] = intval( $row->ar_parent_id );
 214+ }
207215 if ( $fld_user ) {
208216 $rev['user'] = $row->ar_user_text;
209217 }
@@ -297,6 +305,7 @@
298306 ApiBase::PARAM_DFLT => 'user|comment',
299307 ApiBase::PARAM_TYPE => array(
300308 'revid',
 309+ 'parentid',
301310 'user',
302311 'userid',
303312 'comment',
@@ -322,6 +331,7 @@
323332 'prop' => array(
324333 'Which properties to get',
325334 ' revid - Adds the revision ID of the deleted revision',
 335+ ' parentid - Adds the revision ID of the previous revision to the page',
326336 ' user - Adds the user who made the revision',
327337 ' userid - Adds the user ID whom made the revision',
328338 ' comment - Adds the comment of the revision',
Index: trunk/phase3/RELEASE-NOTES
@@ -331,6 +331,7 @@
332332 * (bug 28364) add registration date to meta=userinfo
333333 * (bug 28254) action=paraminfo: Extract type from PARAM_DFLT if
334334 PARAM_TYPE is not set
 335+* (bug 27712) add parent_id to list=deletedrevs
335336
336337 === Languages updated in 1.18 ===
337338

Comments

#Comment by Duplicatebug (talk | contribs)   17:15, 15 April 2011

You have to handle null values for that field. In my opinion it is nicer to have nothing, than parentid="0". Thanks.

#Comment by Duplicatebug (talk | contribs)   19:46, 2 July 2011

Status & tagging log