r112995 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r112994‎ | r112995 | r112996 >
Date:00:51, 5 March 2012
Author:bawolff
Status:ok (Comments)
Tags:
Comment:
(bug 34922) If rev_parent_id is null, then the character delta displayed on Special:Contributions is wrong. In that case instead just display "x bytes". Kind of sticks out, but better than a wrong number (possible alternative is just display no number at all)

No release notes since issue introduced in 1.19 and I'm going to tag this commit for merging.
Modified paths:
  • /trunk/phase3/includes/specials/SpecialContributions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialContributions.php
@@ -792,9 +792,16 @@
793793 array( 'action' => 'history' )
794794 );
795795
796 - $parentLen = isset( $this->mParentLens[$row->rev_parent_id] ) ? $this->mParentLens[$row->rev_parent_id] : 0;
797 - $chardiff = ' . . ' . ChangesList::showCharacterDifference(
798 - $parentLen, $row->rev_len ) . ' . . ';
 796+ if ( $row->rev_parent_id === null ) {
 797+ // For some reason rev_parent_id isn't populated for this row.
 798+ // Its rumoured this is true on wikipedia for some revisions (bug 34922).
 799+ // Next best thing is to have the total number of bytes.
 800+ $chardiff = ' . . ' . Linker::formatRevisionSize( $row->rev_len ) . ' . . ';
 801+ } else {
 802+ $parentLen = isset( $this->mParentLens[$row->rev_parent_id] ) ? $this->mParentLens[$row->rev_parent_id] : 0;
 803+ $chardiff = ' . . ' . ChangesList::showCharacterDifference(
 804+ $parentLen, $row->rev_len ) . ' . . ';
 805+ }
799806
800807 $lang = $this->getLanguage();
801808 $comment = $lang->getDirMark() . Linker::revComment( $rev, false, true );

Follow-up revisions

RevisionCommit summaryAuthorDate
r113174MFT r111795, r111881, r111920, r112573, r112995, r113169reedy20:12, 6 March 2012
r113175MFT r111795, r111881, r111920, r112573, r112995, r113169reedy20:13, 6 March 2012

Comments

#Comment by Reedy (talk | contribs)   16:44, 5 March 2012

I know it was already in the code, but should we be using something more like the message ellipsis?

Both ChangesList and SpecialContributions are apparently the only things that use ' . . '

#Comment by Nikerabbit (talk | contribs)   16:47, 5 March 2012

Ellipsis doesn't feel right in here.

#Comment by Reedy (talk | contribs)   16:50, 5 March 2012

I'd agree with you. It just feels weird using this different format for these few cases

#Comment by Bawolff (talk | contribs)   19:45, 5 March 2012

Yeah I thought it was odd too...

[00:35:27] <bawolff>	whats with all the periods on special:Contribs anyhow?
[00:35:37] <bawolff>	. . (+some numb)??? . .

Status & tagging log