Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • samtzu Friend
    #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 Moderator
    #326002
    samtzu Friend
    #326148

    Thx. I allready checked that thread but the code does not match Mesolite code so I did not dare try to change it.

    Sam :p

    samtzu Friend
    #326388

    I 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]

Viewing 4 posts - 1 through 4 (of 4 total)

This topic contains 4 replies, has 2 voices, and was last updated by  samtzu 14 years, 11 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum