r44585 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r44584‎ | r44585 | r44586 >
Date:17:39, 14 December 2008
Author:catrope
Status:ok
Tags:
Comment:
API: (bug 15579) clshow considers all categories !hidden. Modified patch by Brad Jorsch
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryCategories.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQueryCategories.php
@@ -96,9 +96,20 @@
9797 $this->dieUsage("Incorrect parameter - mutually exclusive values may not be supplied", 'show');
9898 if(isset($show['hidden']) || isset($show['!hidden']))
9999 {
100 - $this->addTables('category');
101 - $this->addWhere(array( 'cl_to = cat_title',
102 - 'cat_hidden' => isset($show['hidden'])));
 100+ $this->addOption('STRAIGHT_JOIN');
 101+ $this->addTables(array('page', 'page_props'));
 102+ $this->addJoinConds(array(
 103+ 'page' => array('LEFT JOIN', array(
 104+ 'page_namespace' => NS_CATEGORY,
 105+ 'page_title = cl_to')),
 106+ 'page_props' => array('LEFT JOIN', array(
 107+ 'pp_page=page_id',
 108+ 'pp_propname' => 'hiddencat'))
 109+ ));
 110+ if(isset($show['hidden']))
 111+ $this->addWhere(array('pp_propname IS NOT NULL'));
 112+ else
 113+ $this->addWhere(array('pp_propname IS NULL'));
103114 }
104115
105116 # Don't order by cl_from if it's constant in the WHERE clause
Index: trunk/phase3/RELEASE-NOTES
@@ -515,6 +515,7 @@
516516 * (bug 16613) action=protect doesn't tell when &cascade was set but cascading
517517 protection wasn't allowed
518518 * (bug 16626) action=delete now correctly handles empty "reason" param
 519+* (bug 15579) clshow considers all categories !hidden
519520
520521 === Languages updated in 1.14 ===
521522

Status & tagging log