WikiPage: Return false from hasDifferencesOutsideMainSlot if no differences at all
authorBrad Jorsch <bjorsch@wikimedia.org>
Wed, 18 Jul 2018 15:14:56 +0000 (11:14 -0400)
committerBrad Jorsch <bjorsch@wikimedia.org>
Wed, 18 Jul 2018 15:14:56 +0000 (11:14 -0400)
If the page has no differences in any slot, the method is incorrectly
returning "true" to claim there are differences in some non-main slot.

Follows up Ifdf9bc9d884844f9ffeb8019d9b13d5737862063.

Bug: T194412
Change-Id: I013bcd9c39d05d9af47c1a29026b14d27af2db15

includes/page/WikiPage.php

index 7cc25bd..424f6b7 100644 (file)
@@ -1470,7 +1470,7 @@ class WikiPage implements Page, IDBAccessObject {
                $bSlots = $b->getRevisionRecord()->getSlots();
                $changedRoles = $aSlots->getRolesWithDifferentContent( $bSlots );
 
-               return ( $changedRoles !== [ 'main' ] );
+               return ( $changedRoles !== [ 'main' ] && $changedRoles !== [] );
        }
 
        /**