-
AuthorPosts
-
December 7, 2009 at 9:45 am #146651
<blockquote>Warning: Invalid argument supplied for foreach() in /var/www/clients/client1/web12/web/templates/ja_mesolite/ja_menus/Base.class.php on line 62</blockquote>
I have searched these forums and this seems to be common error also in other templates but I can’t seem to find the answer that would fix the problems in this template.
In our shop you can see that the problem occurs when you choose a virtuemart subcategory change language and change back to english.
Any help would be appriciated.
Sam
Anonymous ModeratorJA Developer
- Join date:
- September 2014
- Posts:
- 9914
- Downloads:
- 207
- Uploads:
- 152
- Thanks:
- 1789
- Thanked:
- 2008 times in 1700 posts
December 8, 2009 at 7:07 am #326002Hi samtzu
please check this thread: http://www.joomlart.com/forums/topic/invalid-argument-supplied-for-foreach-in-3/
December 9, 2009 at 7:54 am #326148Thx. I allready checked that thread but the code does not match Mesolite code so I did not dare try to change it.
Sam :p
December 12, 2009 at 8:03 pm #326388I think I was able to ‘adapt’ the solution to fit Mesolite template.
Here is my altered code… (please let me know if I broke anything. I’m not a coder.)[PHP] // first pass – collect children
$cacheIndex = array();
$this->items = array();
if (sizeof($rows) > 0) {
foreach ($rows as $index => $v) {
if ($v->access <= $aid) {
$pt = $v->parent;
$list = @ $children[$pt] ? $children[$pt] : array ();switch ($v->type)
{case ‘url’ :
if ((strpos($v->link, ‘index.php?’) !== false) && (strpos($v->link, ‘Itemid=’) === false)) {
$v->url = $v->link.’&Itemid=’.$v->id;
} else {
$v->url = $v->link;
}
break;default :
$router = JSite::getRouter();
$v->url = $router->getMode() == JROUTER_MODE_SEF ? ‘index.php?Itemid=’.$v->id : $v->link.’&Itemid=’.$v->id;
break;}
// Handle SSL links
$iParams = $this->createParameterObject($v->params);
$iSecure = $iParams->def(‘secure’, 0);
if ($v->home == 1) {
$v->url = JURI::base();
} elseif (strcasecmp(substr($v->url, 0, 4), ‘http’) && (strpos($v->link, ‘index.php?’) !== false)) {
$v->url = JRoute::_($v->url, true, $iSecure);
} else {
$v->url = str_replace(‘&’, ‘&’, $v->url);
}$v->_idx = count($list);
array_push($list, $v);
$children[$pt] = $list;
}
$cacheIndex[$v->id] = $index;
$this->items[$v->id] = $v;
}
}
[/PHP] -
AuthorPosts
This topic contains 4 replies, has 2 voices, and was last updated by samtzu 15 years ago.
We moved to new unified forum. Please post all new support queries in our New Forum