When editing a page within your section, the default section that is selected is on the same level as the node itself, not the parent node. Saving the page without noticing this ends up creating a copy of the page as a child of the original page.

e.g. a menu structure like this:
-top
--child1

Editing node "child1", the selected section will be "--child1" instead of "-top". Saving this would give you a new structure of:

-top
--child1
---child1

Comments

agentrickard’s picture

Did you come to the edit page through a link from the user 'Sections' page or from normal node editing?

agentrickard’s picture

Is 'top' in this case the Menu top level or a node or menu item?

agentrickard’s picture

Disregard the above comments. Bug confirmed.

The isseue, actually, seems to be that we are not verifying that a unique menu id is being passed before creating the menu item.

agentrickard’s picture

Title: Wrong section selected when editing node » Child menu items created when editing node
Status: Active » Needs work
StatusFileSize
new1.54 KB

Here is a partial patch that prevents this problem.

The issue that remains is that a node can be assigned to more than one menu and can actually have multiple menu items. This feature currently has trouble with that.

The attached patch stops the creation of a new menu item if one already exists, but this is only a partial fix, because it will not allow these editors with limited permissions to move a node from one section to another.

Title change, since the problem is not the _location_ of the menu items, but the fact that we are creating duplicate items when using this form element.

bae22’s picture

Thanks for the quick response.

I'll test the patch today and let you know how it goes.

bae22’s picture

The patch seems to work.

Slightly confused that when editing a node, it still selects the section level of the node rather than the parent level, but saving it does not create a child page any more.

agentrickard’s picture

What do you mean by parent level?

agentrickard’s picture

Status: Needs work » Needs review
StatusFileSize
new4.19 KB

The parent level bit is unchanged, but the UI is a little tricky. I have cleaned that up some -- notably by collapsing the fieldset and changing the help text if a menu item has already been assigned to a node.

By design, when you first create a node, you must choose its 'parent' section. This then becomes visible in the form during later edits.

When a user with the 'publish to my sections' permission first creates a node, she has the option of _not_ assigning it to a menu section. However, once that item is assigned to a section, only a user who may 'administer menu' may remove it.

agentrickard’s picture

StatusFileSize
new10.89 KB
new1.64 KB

There is actually a bug in Menu Node API as well.

Both patches are required.

bae22’s picture

Just tested it quickly (it is the end of the work day here in the UK!) and it looks as though it works perfectly.

I will test it thoroughly tomorrow, with Modr8 and Revision Moderation.

Thanks ever so much

agentrickard’s picture

Well, I have the prototype of this in production use, so I need to squash these ASAP, but (obviously) need confirmation.

bae22’s picture

Tested it this morning. Seems to work exactly as expected. Also tested it with Revision Moderation module; no problems there either. Can't find any faults.

agentrickard’s picture

Status: Needs review » Fixed

Yay!

I am going to commit and roll a 6.x.1.1 of both modules.

Thanks!

agentrickard’s picture

Status: Fixed » Closed (fixed)