MidCOM: endless loop in _basicnav.php

Ingo Herz <[email protected]> Thu, 20 Oct 2005 11:01:18 +0200
Newsgroups gmane.comp.web.midgard.user
Message-ID <[email protected]>
Hello @all,

after some hours of try&error I got one of my midcom-sites running now with 
midgard 1.7.2/midcom 2.4.5 :)

The last problem for now was an endless loop in 
midcom/lib/midcom/helper/_basicnav.php For some reason it thinks, that the 
root topic has viewergroups defined (they are NOT set) and it can not be 
shown. After that it loops until max execution time. This has also been 
reported to the bug tracker (issue 248).
My solution was to add the 2nd condition to the if-statement:

        if ((! is_null($napdata[MIDCOM_NAV_VIEWERGROUPS])) &&
            (count($napdata[MIDCOM_NAV_VIEWERGROUPS]) <> 0))
        {
            $visible = false;
            foreach ($napdata[MIDCOM_NAV_VIEWERGROUPS] as $guid)
            {
                if ($GLOBALS["midcom"]->check_memberships($guid))
                {
                    // User is member of a viewer group
                    $visible = true;
                }
            }

But I really don't know what is going on with $napdata[]...

ingo