Hi,
I've encountered a slight issue with the module when a page already has a menu link in a menu that it's not allowed to. Upon loading the form, the #default_value for the parent is set to a value that's not in the #options set by ctm, but the menu link title is still set, so if the user doesn't notice this and saves the node, it gets reparented parented to the top of whatever menu comes first in the list.
I suggest that in these cases the module should allow the existing link to remain, but once they switch the parent to another menu, the disallowed menu is no longer an option.
I've attached a simple patch that allows the menu currently specified in $form['menu']['parent']['#default_value'] to be selected, even if it's not a configured menu. This could possibly be enhanced further to show a message warning them that the node is in a disallowed menu too, but I didn't need that in my case.
Thanks
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | ctm-preserve_existing-864582_10.patch | 528 bytes | aaronbauman |
| #6 | 864582.6-ctm_preserve_existing.patch | 830 bytes | mrfelton |
| #3 | 864582-3-ctm_preserve_existing.patch | 927 bytes | aaronbauman |
| #1 | ctm.module.allowremain.patch | 1.07 KB | aaronbauman |
| ctm.module.allowremain.patch | 1.07 KB | neilnz |
Comments
Comment #1
aaronbauman+1! This is quite vexing behavior!
However, this patch appears to have been inverted.
Updated patch to apply this fix, rather than remove it.
Comment #2
aaronbaumanMarking this a bug since it degrades existing behavior.
Comment #3
aaronbaumanACK - neither patch from OP nor from #1 applies cleanly.
Let's try this one
Comment #4
vasikeComment #5
mrfelton commentedWhy is this marked as fixed?? - it's not in 1.1 or the latest dev code.
Comment #6
mrfelton commentedAttached is a version that applies cleanly to 6.x-1.x. Please can we get this committed, things can really get screwed up without it, with pages being reparented to completely the wrong menu.
Comment #7
vasikehttp://drupalcode.org/project/ctm.git/commit/113dafa commited. thanks a lot
Comment #9
imclean commentedThere's a slight change to how this works being discussed in #1088000: Can't deselect all menus.
Comment #10
aaronbaumanI was disappointed to see that this is still broken in 2.x
Here's a patch.
Comment #11
vasike