I noticed that if you have several Categories and dozens of subcategories, the pagination doesnt work anymore in administrator modus. The first page of categories always works, but all others wont. They dont show a single category, even if there are plenty of them.
in "administrator\components\com_easygallery\classes\categories.php" i found a small glitch. The Recursive Tree Generator wont work if you dont have the root of the tree. I mean, if you set a query limit, the result may start at a point <> root.
To fix this the easy way, i will get all records from database, build the tree and then slice the tree. that way it works fine.
And heres what i've done:
in: administrator\components\com_easygallery\classes\categories.php
search:
$query = str_replace("%s", "*", $basequery) . ' LIMIT ' . $limitstart . ', ' . $limit;
$database->setQuery($query);
$rows = $database->loadObjectList();
echo $database->getErrorMsg();
replace with:
$query = str_replace("%s", "*", $basequery); // . ' LIMIT ' . $limitstart . ', ' . $limit;
$database->setQuery($query);
$rows = $database->loadObjectList();
echo $database->getErrorMsg();
search (
attention! replace the first occurrence only!! In function show() ):
//loop through all items
for($i=0,$n=count($tree[0]);$i<$n;$i++){
$row = $tree[0][$i];
categories::recurseCategorie($tree, $final, $row, $level);
}
replace with:
//loop through all items
for($i=0,$n=count($tree[0]);$i<$n;$i++){
$row = $tree[0][$i];
categories::recurseCategorie($tree, $final, $row, $level);
}
//cut tree to selected area
$final = array_slice($final, $limitstart, $limit);
Greets!
