Joomla Xmap Implode Error on Sitemap
-
20-06-2021 - |
Question
I am getting the following error on an 'xmap' sitemap plugin used on Joomla v2.5 with the K2 cck on one of my sites as below:
Warning: implode() [function.implode]: Invalid arguments passed in /home/anctest/public_html/plugins/xmap/com_k2/com_k2.php on line 192
Its pointing to the following line in the below code:
$query = $baseQuery."catid in (".implode(",", $ids).") order by 1 DESC ";
Code here:
case "categories":
if (!self::$suppressSub)
{
$query = $baseQuery."catid in (".implode(",", $ids).") order by 1 DESC ";
$db->setQuery($query);
$rows = $db->loadObjectList ();
}
else
{
$rows = array();
if (is_array($ids))
{
foreach($ids as $id)
{
$allrows = array();
xmap_com_k2::collectByCat($db, $id, $allrows);
$rows = array_merge($rows, $allrows);
}
}
}
Any ideas?
Thanks
Solution
$ids not an array
file_put_contents('log.txt',var_export($ids,true));
or var_dump($ids)
$ids in this case gets from link parameters in menu. Maybe categories not selected for this link. var_dump($parent->link)
will show you all links, and a link before the error will be the problem link.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow