Retrieve rev_len for sizediff in usercontributions API
authorPetr Onderka <gsvick@gmail.com>
Sat, 7 Jul 2012 13:16:56 +0000 (15:16 +0200)
committerPetr Onderka <gsvick@gmail.com>
Sat, 7 Jul 2012 13:16:56 +0000 (15:16 +0200)
The sizediff parameter introduced in I6e388e75 requires
the rev_len field, but it wasn't added to the condition
for that field.

This means prop=size|sizediff worked, but prop=sizediff
alone didn't. This patch fixes that.

Change-Id: Ib15814d809398ca3d4633149af0ce62489d8adaa

includes/api/ApiQueryUserContributions.php

index f531980..4161dd7 100644 (file)
@@ -256,7 +256,7 @@ class ApiQueryContributions extends ApiQueryBase {
                $this->addFieldsIf( 'page_latest', $this->fld_flags );
                // $this->addFieldsIf( 'rev_text_id', $this->fld_ids ); // Should this field be exposed?
                $this->addFieldsIf( 'rev_comment', $this->fld_comment || $this->fld_parsedcomment );
-               $this->addFieldsIf( 'rev_len', $this->fld_size );
+               $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( 'rc_patrolled', $this->fld_patrolled );