Hi Thalionmel,
I thought I was going crazy when I cam upon this stupid bug myself. I have two instances of Mambo and they BOTH were not showing any categories if I added more than two. I don't know when it started happenning, but its been a real pain. I tried every combination of adding and removing links and categories from the web links component and was able to show three categories on one, but not on the other. I even dumped the tables and restored the original 1.0.9 weblinks.php file to be sure I didn't break it. After much effort I decided to rewrite the query and have since fixed the problem.
The code below is from weblinks.php and is currently working properly.
PHP Code:
/* Query to retrieve all categories that belong under the web links section and that are published.
This is the original query that didn't work consistently!!!
$database->setQuery( "SELECT *, COUNT(a.id) AS numlinks FROM #__categories AS cc"
. "\nLEFT JOIN #__weblinks AS a ON a.catid = cc.id"
. "\nWHERE a.published='1' AND section='com_weblinks' AND cc.published='1' AND access <= '$my->gid'"
. "\nGROUP BY cc.id"
. "\nORDER BY cc.ordering"
);
*/
$database->setQuery( "SELECT cc.id, cc.title, cc.name, cc.image, cc.section, cc.description, SUM(a.published) AS numlinks"
. "\nFROM #__categories AS cc LEFT JOIN #__weblinks AS a ON a.catid = cc.id"
. "\nWHERE cc.section='com_weblinks' AND cc.published='1' AND cc.access <= '$my->gid'"
. "\nGROUP BY cc.id, cc.title, cc.name, cc.image, cc.description"
. "\nORDER BY cc.ordering"
);
I hope you find this useful and that this fixed query finds its way into the com_weblinks component.
Cheers,
Mark