From: <ch...@us...> - 2011-09-11 21:07:22
|
Revision: 37158 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=37158&view=rev Author: chealer Date: 2011-09-11 21:07:16 +0000 (Sun, 11 Sep 2011) Log Message: ----------- [FIX] CategLib: get_category_descendants() did not return the base category (r37055 regression, oops) Warn on limited intuitiveness Thanks lindon Revision Links: -------------- http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=37055&view=rev Modified Paths: -------------- trunk/lib/categories/categlib.php Modified: trunk/lib/categories/categlib.php =================================================================== --- trunk/lib/categories/categlib.php 2011-09-11 21:06:00 UTC (rev 37157) +++ trunk/lib/categories/categlib.php 2011-09-11 21:07:16 UTC (rev 37158) @@ -271,6 +271,7 @@ } } + // WARNING: This may not do what you would think from the name. // Returns an array of the OIDs of a set of categories. // $categId is an integer. // If $categId is 0, that set is the set of all categories. @@ -278,7 +279,7 @@ function get_category_descendants($categId) { if ($categId) { $category = $this->get_category($categId); - return $category['descendants']; + return array_merge(array($categId), $category['descendants']); } else { $categories = $this->getCategories(NULL, false, false); $roots = TikiLib::lib('cache')->getSerialized('roots', 'allcategs'); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |