Only call ->clearInstanceCache() if $targetUser instanceof User
authorKunal Mehta <legoktm@gmail.com>
Wed, 12 Feb 2014 05:44:34 +0000 (21:44 -0800)
committerKunal Mehta <legoktm@gmail.com>
Wed, 12 Feb 2014 05:44:34 +0000 (21:44 -0800)
Bug: 61252
Change-Id: Ibb79ca9a27e50b58fdd5dd541e243054fb095753

includes/specials/SpecialUserrights.php

index b4757e0..a6b3602 100644 (file)
@@ -152,7 +152,10 @@ class UserrightsPage extends SpecialPage {
                        }
 
                        $targetUser = $status->value;
-                       $targetUser->clearInstanceCache();
+                       if ( $targetUser instanceof User ) { // UserRightsProxy doesn't have this method (bug 61252)
+                               $targetUser->clearInstanceCache(); // bug 38989
+                       }
+
 
                        if ( $request->getVal( 'conflictcheck-originalgroups' ) !== implode( ',', $targetUser->getGroups() ) ) {
                                $out->addWikiMsg( 'userrights-conflict' );