Merge "Fix documentation lies about debug toolbar / cache interaction"
[lhc/web/wiklou.git] / includes / changes / EnhancedChangesList.php
index d687614..946c6d1 100644 (file)
@@ -287,11 +287,19 @@ class EnhancedChangesList extends ChangesList {
                if ( $RCShowChangedSize && !$allLogs ) {
                        $last = 0;
                        $first = count( $block ) - 1;
-                       # Some events (like logs) have an "empty" size, so we need to skip those...
-                       while ( $last < $first && $block[$last]->mAttribs['rc_new_len'] === null ) {
+                       # Some events (like logs and category changes) have an "empty" size, so we need to skip those...
+                       while ( $last < $first && (
+                                       $block[$last]->mAttribs['rc_new_len'] === null ||
+                                       # TODO kill the below check after March 2016 - https://phabricator.wikimedia.org/T126428
+                                       $block[$last]->mAttribs['rc_type'] == RC_CATEGORIZE
+                               ) ) {
                                $last++;
                        }
-                       while ( $first > $last && $block[$first]->mAttribs['rc_old_len'] === null ) {
+                       while ( $last < $first && (
+                                       $block[$first]->mAttribs['rc_old_len'] === null ||
+                                       # TODO kill the below check after March 2016 - https://phabricator.wikimedia.org/T126428
+                                       $block[$first]->mAttribs['rc_type'] == RC_CATEGORIZE
+                               ) ) {
                                $first--;
                        }
                        # Get net change
@@ -495,10 +503,11 @@ class EnhancedChangesList extends ChangesList {
                /** @var $block0 RecentChange */
                $block0 = $block[0];
                $last = $block[count( $block ) - 1];
-               if ( !$allLogs && $rcObj->mAttribs['rc_type'] != RC_CATEGORIZE ) {
-                       if ( !ChangesList::userCan( $rcObj, Revision::DELETED_TEXT, $this->getUser() ) ) {
-                               $links['total-changes'] = $nchanges[$n];
-                       } elseif ( $isnew ) {
+               if ( !$allLogs ) {
+                       if ( !ChangesList::userCan( $rcObj, Revision::DELETED_TEXT, $this->getUser() ) ||
+                               $isnew ||
+                               $rcObj->mAttribs['rc_type'] == RC_CATEGORIZE
+                       ) {
                                $links['total-changes'] = $nchanges[$n];
                        } else {
                                $links['total-changes'] = Linker::link(