This has happened twice in the last half an hour, so I doubt if this is by chance.

Background:
I have one master hierarchy for my entire site and several containers pointing to major sections of my site. I moved these containers into a custom menu at admin menu and enabled this block for navigating the web site instead of using the primary links.

Problem:

  1. When I added content to the body portion of a container that had several sub-containers and saved the changes, the menu link fo the container disappeared from the custom menu and reappeared at the top level of admin navigation.
  2. I deleted the child containers and instead added categories and saved it. Then, I edited the container again and removed the 'Required' check from 'Container information' and saved the changes. The menu link again disappeared from the custom menu and reappeared at the top of admin navigation.

At the moment, I haven't tested if this is a problem with this specific container or with all the other containers.

Comments

venkat-rk’s picture

StatusFileSize
new4.28 KB
venkat-rk’s picture

Sorry, the order of screenshots got messed up.

betsyj’s picture

I have encountered the same problem. Thanks, Ramdak, for taking the time to document it.

vatavale’s picture

And I have the same problem.

vatavale’s picture

Priority: Normal » Critical
venkat-rk’s picture

Betsy and Vatavale, thanks for confirming I am not alone.

venkat-rk’s picture

I am not sure if this another bug or a variation of the same one, but when I moved the 'Programmes' menu back to Primary links and then changed its weight (which seemed to have changed on its own), it disappeared from Primary links and reappeared at the top of Admin navigation menu.

venkat-rk’s picture

Another variation:-)

1.) Moved all the container menu links to Primary links
2.) Added categories to a container which didn't have TOC enabled. This made the categories into secondary links in the header section of bluemarine
3.) Edited the container to enable the ToC and saved the changes
4.) The container menu link, along with its child menu items shifts to the top of the admin navigation menu

venkat-rk’s picture

StatusFileSize
new16.42 KB

Hi Jaza,

Sorry for bugging you about this bug, but the latest variation is the following:

1.) Category containers need to be primary links
2.) You add categories to one of these containers and also enable ToC
3.) When you make a post tagging one of these categories, the categories reappear as secondary links, although the ToC remains okay.

Attaching a screenshot.

In sum, there appear to be two problems:

1.) Updates to containers shifts menu items if they are also primary links
2.) Primary links appear to clash with container that have child categories and ToC enabled.

marknunney’s picture

I have the same:

I added my containers to a new menu item (called ‘Content’, so the ‘parent item’ in ‘menu settings’ is ‘Content’) and configured them to ‘expand’.

If I then go to one of the container’s edit pages and ‘submit’ (no changes need be made) the container is moved to the ‘Primary Links’.

Interestingly, the value for ‘parent item’ displayed on the container’s edit page is still ‘Content’, as set. To change this, I click on the ‘edit the advanced settings’ link to get to ‘edit menu item’.

On that ‘edit menu item’ page, I see the Parent Item set as Primary Links and the ‘Expanded’ box unchecked. Here I reset them and all is well until the next time I ‘submit’ the container.

Screen grabs available if wanted.

On a different site, I’ve had a similar problem to Ramdak’s similar problem with ‘Programmes’. There a containers was first assigned to Primarly links but on ‘submit’ resets to the Administer menu.

venkat-rk’s picture

For the time being, I have let the menu links remain in the default navigation menu (instead of primary links or a custom menu) and manually disabled menu links not meant for anonymous users. All is peace now:-)

venkat-rk’s picture

Hi Jaza,

I experienced this bug again just now. I created containers and moved them to primary links. When I added some child containers to those containers, the main container automatically jumped from primary links to the admin navigation menu.

venkat-rk’s picture

Same problem when a container menu link is moved to a custom menu and the custom menu is then set for defining secondary links at administer>>settings>>menus

The moment I edited the container inadvertently and saved the changes, the link jumped from secondary links back to admin navigation menu.

chud’s picture

I am using the category module for our new site: http://www.3ring.com/

So far the category module has been a great success. However, I am experiencing this same problem where I have manually moved some menu items to new menu blocks. These menu blocks contain items that are only relevant to the section of the site you are in. Everything works great except when you are editing the category page that is at the top of that particular menu blocks' menu tree -- it would always get relocated to the 'default' menu which is 'navigation'.

I have come up with a solution by hacking the category_menu module. Here is the diff (sorry not sure which version -- I think CVS from about 3 weeks ago):

Index: category_menu.module
===================================================================
--- category_menu.module	(revision 69)
+++ category_menu.module	(working copy)
@@ -516,7 +516,13 @@
   }
   $item['mid'] = $mid;
 
-  $pid = category_menu_get_mapping($parent);
+  // check if a menu item has been manually relocated and if so, keep existing parent
+  if (category_menu_get_mapping($parent) == 0 && $node->menu['pid']) {
+    $pid = $node->menu['pid'];
+  } else {
+    $pid = category_menu_get_mapping($parent);
+  }
+  
   $parent_path = 'node/'. $parent;
   if ($pid) {
     $item['pid'] = $pid;

If you can't apply the patch, then do this. Replace:


$pid = category_menu_get_mapping($parent);

...with:

  
  if (category_menu_get_mapping($parent) == 0 && $node->menu['pid']) {
    $pid = $node->menu['pid'];
  } else {
    $pid = category_menu_get_mapping($parent);
  }

I'd submit this as a patch but it won't work in all situations... but it does in mine. I think the desired logic would be as follows:

1. if the category has changed then allow normal category_menu behavior (i.e. move the menu item according to the category it is in)

2. if the category has not changed, keep the currently defined menu position

Does anyone know if there are plans to address this? Ideally it would be cool if you could associate a default menu block with a category/container.

One more thing- if you don't want to hack the category_menu module, you could take an alternate approach:

1. Create a new module with a nodeapi hook

2. Set the module weight to -1 so that it executes before the category_menu module (edit the systems table to do this)

3. In the 'update' operation of nodeapi, change the category_menu_default_menu variable to the menu block that you want to use

4. The result is that the menu item will just use the default setting (which you have cleverly set just before the category menu reads it)

I think this would work... I got partially down that path and then decided to hack the category_menu module instead.

chud’s picture

Found a better way.

Ok, I reverted that little hack I did.

Instead, I put all the menu items in one block (i.e. the category module's native behaviour). Then I added some simple CSS:


#leftNavContainerTop li.collapsed {
  display: none;
  }

(#leftNavContainerTop is just the div ID I happen to be using)

This will hide all collapsed menus -- therefore, only the menu that is currently in context will be displayed because it is expanded. This, of course, assumes that you do not have your menus expanded by default. View the left navigation at 3ring.com to see what I mean.

Colin

Jaza’s picture

Status: Active » Closed (works as designed)

OK guys, this problem is exactly how category_menu is designed to work, so technically it's not a bug. But clearly, the way the 'default menu' functionality is behaving at the moment is not desirable in many situations. I'm going to be working on a solution that will get around this and other problems in category_menu - not sure exactly how it's going to work yet.

venkat-rk’s picture

Okay, Jaza. If the cat_menu issues can be buried and cat_pathauto becomes stable with the latest fixes, I can throw away the taxonomy and book modules that I have had to reluctantly make friends with again;-)