MediaWiki r47767 - Code Review

Jump to: navigation, search
Repository:MediaWiki
Revision:r47766‎ | r47767 (on ViewVC)‎ | r47768 >
Date:22:13, 24 February 2009
Author:brion
Status:resolved (Comments)
Tags:
Comment:
* Added $wgUseTagFilter to control enabling of filter-by-change-tag
Modified paths:

Diff [purge]

Index: trunk/phase3/includes/ChangeTags.php
===================================================================
--- trunk/phase3/includes/ChangeTags.php	(revision 47766)
+++ trunk/phase3/includes/ChangeTags.php	(revision 47767)
@@ -91,8 +91,12 @@
 	 * Needs $tables to be set up properly, so we can figure out which join conditions to use.
 	*/
 	static function modifyDisplayQuery( &$tables, &$fields,  &$conds, &$join_conds, $filter_tag = false ) {
-		global $wgRequest;
+		global $wgRequest, $wgUseTagFilter;
 		
+		if( !$wgUseTagFilter ) {
+			return;
+		}
+		
 		if ($filter_tag === false) {
 			$filter_tag = $wgRequest->getVal( 'tagfilter' );
 		}
@@ -129,8 +133,9 @@
 	 * If $fullForm is true, it returns an entire form.
 	 */
 	static function buildTagFilterSelector( $selected='', $fullForm = false /* used to put a full form around the selector */ ) {
-
-		if ( !count( self::listDefinedTags() ) )
+		global $wgUseTagFilter;
+		
+		if ( !$wgUseTagFilter || !count( self::listDefinedTags() ) )
 			return $fullForm ? '' : array();
 	
 		global $wgTitle;
Index: trunk/phase3/includes/DefaultSettings.php
===================================================================
--- trunk/phase3/includes/DefaultSettings.php	(revision 47766)
+++ trunk/phase3/includes/DefaultSettings.php	(revision 47767)
@@ -3738,3 +3738,9 @@
  * Preprocessor caching threshold
  */
 $wgPreprocessorCacheThreshold = 1000;
+
+/**
+ * Allow filtering by change tag in recentchanges, history, etc
+ * Has no effect if no tags are defined in valid_tag.
+ */
+$wgUseTagFilter = true;
Index: trunk/phase3/RELEASE-NOTES
===================================================================
--- trunk/phase3/RELEASE-NOTES	(revision 47766)
+++ trunk/phase3/RELEASE-NOTES	(revision 47767)
@@ -118,6 +118,7 @@
 * Add an ID if 'missingsummary' is triggered to allow styling of the summary
   line
 * Add logging to password resets if not resetting your own
+* Added $wgUseTagFilter to control enabling of filter-by-change-tag
 
 === Bug fixes in 1.15 ===
 * (bug 16968) Special:Upload no longer throws useless warnings.

Comments

#Comment by Brion VIBBER (Talk | contribs)   22:20, 24 February 2009

Breakage in history. Some other code appears to be assuming fields will be added which aren't when the filter search is disabled.

#Comment by Brion VIBBER (Talk | contribs)   22:43, 24 February 2009

Resolved by r47769

Status & tagging log

Personal tools
Namespaces
Variants
Views
Actions
Site
Support
Download
Development
Communication
Toolbox