Merge "Converted ChangeTags to using the WAN cache"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 7 May 2015 19:30:24 +0000 (19:30 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 7 May 2015 19:30:24 +0000 (19:30 +0000)
1  2 
includes/changetags/ChangeTags.php

@@@ -1217,25 -1222,8 +1223,26 @@@ class ChangeTags 
                }
  
                // Cache for a very short time
-               $wgMemc->set( $key, $out, 300 );
+               $cache->set( $key, $out, 300 );
                return $out;
        }
 +
 +      /**
 +       * Indicate whether change tag editing UI is relevant
 +       *
 +       * Returns true if the user has the necessary right and there are any
 +       * editable tags defined.
 +       *
 +       * This intentionally doesn't check "any addable || any deletable", because
 +       * it seems like it would be more confusing than useful if the checkboxes
 +       * suddenly showed up because some abuse filter stopped defining a tag and
 +       * then suddenly disappeared when someone deleted all uses of that tag.
 +       *
 +       * @param User $user
 +       * @return bool
 +       */
 +      public static function showTagEditingUI( User $user ) {
 +              return $user->isAllowed( 'changetags' ) && (bool)self::listExplicitlyDefinedTags();
 +      }
  }