Add parentid to output of list=usercontribs

This makes it consistent with prop=revisions. Was requested on
irc by Betacommand.

Change-Id: Idfbee9b4f089738ab70825c11945faf8dd3da66d
This commit is contained in:
Brian Wolff 2013-04-23 18:01:32 -03:00 committed by Gerrit Code Review
parent edf169b448
commit 6793fe0bf4
2 changed files with 11 additions and 2 deletions

View file

@ -72,6 +72,7 @@ production.
longer be), and will no longer choke on booleans.
* action=opensearch no longer silently ignores the format parameter.
* action=opensearch now supports format=jsonfm.
* list=usercontribs&ucprop=ids will now include the parent revision id.
=== Languages updated in 1.22===

View file

@ -255,7 +255,7 @@ class ApiQueryContributions extends ApiQueryBase {
$this->addFieldsIf( 'rev_comment', $this->fld_comment || $this->fld_parsedcomment );
$this->addFieldsIf( 'rev_len', $this->fld_size || $this->fld_sizediff );
$this->addFieldsIf( 'rev_minor_edit', $this->fld_flags );
$this->addFieldsIf( 'rev_parent_id', $this->fld_flags || $this->fld_sizediff );
$this->addFieldsIf( 'rev_parent_id', $this->fld_flags || $this->fld_sizediff || $this->fld_ids );
$this->addFieldsIf( 'rc_patrolled', $this->fld_patrolled );
if ( $this->fld_tags ) {
@ -297,6 +297,10 @@ class ApiQueryContributions extends ApiQueryBase {
$vals['pageid'] = intval( $row->rev_page );
$vals['revid'] = intval( $row->rev_id );
// $vals['textid'] = intval( $row->rev_text_id ); // todo: Should this field be exposed?
if ( !is_null( $row->rev_parent_id ) ) {
$vals['parentid'] = intval( $row->rev_parent_id );
}
}
$title = Title::makeTitle( $row->page_namespace, $row->page_title );
@ -474,7 +478,11 @@ class ApiQueryContributions extends ApiQueryBase {
),
'ids' => array(
'pageid' => 'integer',
'revid' => 'integer'
'revid' => 'integer',
'parentid' => array(
ApiBase::PROP_TYPE => 'integer',
ApiBase::PROP_NULLABLE => true
)
),
'title' => array(
'ns' => 'namespace',