CMS MADE SIMPLE FORGE

CMS Made Simple Core

 

[#5851] MenuManager: $node->parent not working properly

avatar
Created By: Nils Brauneberger (nils73)
Date Submitted: Thu Dec 16 02:43:33 -0500 2010

Assigned To:
Version: 1.9.2
CMSMS Version: None
Severity: Major
Resolution: Won't Fix
State: Closed
Summary:
MenuManager: $node->parent not working properly
Detailed Description:
After upgrading to 1.9.2 I discovered, that $node->parent in MenuManager is not
working properly when having separate menus (i.e. menu-tags with different
templates). It used to be working before but with new MenuManager / Hierarchy it
is not working anymore. $node->parent is only "true" (1) when I output the whole
page-tree at once.


History

Comments
avatar
Date: 2010-12-16 14:17
Posted By: Philippe Thomas (filto)

something strange here :

modules/MenuManager/MenuManager.module.php

L322 to 335

		  // content is a parent of the current page.
		  if( is_array($params) && isset($params['number_of_levels']) )
		    {
		      $a = count(explode('.',$gCms->variables['friendly_position']));
		      $nl = (int)$params['number_of_levels'];
		      if( $nl - $onenode->depth >= $a )
			{
			  $onenode->parent = true;
			}
		    }
		  else
		    {
		      $onenode->parent = true;
		    }

replace all by this line like it was on version 1.8.2 (or use // )

$onenode->parent = true;

It solve but i'dont know why.... ?!

strange to see      if ..... true  else .... true
      
avatar
Date: 2010-12-17 22:36
Posted By: Robert Campbell (calguy1000)

Fixed in MenuManager R192
      
avatar
Date: 2010-12-19 08:39
Posted By: Antoine Josserand (a.josserand)

This issue wasn't solved for me, even after I used MenuManager R193.
$node->parent was still not set properly when used with number_of_levels set to
1. So I fxed this by changing lines 317 onwards to:

          if (isset($gCms->variables["friendly_position"]))
            {
if(
startswith($gCms->variables['friendly_position'],$content->Hierarchy().'.') )
                {
                      $onenode->parent = true;
                }
            }

HTH.

I never looked at the CMSMS code before so please excuse me if my fix is out of
order.

Cheers,

Antoine.
      
avatar
Date: 2010-12-23 13:22
Posted By: Philippe Thomas (filto)

where is R192 ? i can't find it...(imiss something)

still have to use this code in order to be able to see sub-menu.

if (isset($gCms->variables["friendly_position"]))
	    {
if (strstr($gCms->variables["friendly_position"] . '.',
$content->Hierarchy() . '.') == $gCms->variables["friendly_position"] . '.')
		{
$onenode->parent = true;
}
}

------------------
Minor
 
Also saw  from Modules  or System information :

MenuManager Version 1.7.4

shoud be 1.4.1

      
avatar
Date: 2010-12-26 07:16
Posted By: Antoine Josserand (a.josserand)

It took me ages to find it too...

http://viewsvn.cmsmadesimple.org/filedetails.php?repname=menumanager&path=%2Ftrunk%2FMenuManager.module.php

HTH.
      
avatar
Date: 2010-12-27 18:08
Posted By: Philippe Thomas (filto)

Still have to use my code even after apply R192.

I have created a variable in my menu .TPL

but it doesn't pass and apply on page  layout without my code on
MenuManager.module.php on  CMSMS 1.9.2

maybe not a bug...

but strange because i'don't need to use this on CMSMS 1.8.2

Does someone can confirm me that variable create in menu .tpl is pass to global
layout ?

Sorry for my English


      
avatar
Date: 2010-12-28 15:41
Posted By: Nils Brauneberger (nils73)

Tried R193 but it didn't work. Still I get no result for $node->parent when
using two separate menus. Sorry to say.
      
avatar
Date: 2010-12-30 10:00
Posted By: Nils Brauneberger (nils73)

See last comment, sorry ... forgot to update here. Won't fix.
      
avatar
Date: 2011-01-17 07:17
Posted By: Ronny Krijt (ronnyk)

Nils, 

do you mean with this last remark, that it is working as expected now?

Ronny
      
avatar
Date: 2011-02-04 14:57
Posted By: Scott Zetlan (szetlan)

What's going on with this one?  Is this a bug in CMS MS Core, or is there a
better place to log the bug?
      
avatar
Date: 2011-02-11 10:40
Posted By: Ronny Krijt (ronnyk)

1.9.3 is released
      
avatar
Date: 2011-03-03 09:42
Posted By: Philippe Thomas (filto)

Solved with update to 1.9.3


      
Updates

Updated: 2011-02-11 10:40
state: Open => Closed

Updated: 2010-12-30 10:00
resolution_id: 7 => 8

Updated: 2010-12-17 22:36
resolution_id: => 7