The Submenutree and Siblingmenutree menus just start appearing on the node view when menus are disabled for a content type. I think there is an issue with the permissions here, because the whole form just appears even to anonymous users.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | submenutree-349143-patch-1.txt | 691 bytes | bengtan |
| #3 | submenutree-349143-4-no-menu-fieldset-check-patch.txt | 818 bytes | alan d. |
Comments
Comment #1
Mac Clemmens commentedPosted a bug report on that module's page as well #349144: Conflict with Submenutree module
Comment #2
peter panes commentedAlso get the same problem with the module Menuless Node Type
Comment #3
alan d. commentedJust hit this one myself after installing ctm too.
Questions for the developer to consider in the comments below:
The attached patch is for the negative - no fieldset then ignore.
Cheers
Alan
Comment #4
bengtan commentedHi,
Thanks for your information. Not having used the Menu Settings Per Content Type module myself, I didn't really look into this issue.
I've generated a prospective patch. Compared with your code snippet ...
I think user_access('administer menu') is redundant. That is already tested for by menu_form_alter(), which is the code that injects $form['menu'].
Later in your code snippet ... why do you have that code stanza that recreates $form['menu']? Is there something I should know about?
Comment #5
alan d. commentedMy first patch had a similar thing. The code chunk pasted in was a combo of different options, sorry if it was confusing.
The big difference is the check on the form being processed. The check on the node type in the first patch is consistent with the core menu hook_form_alter(). The question is why core does a more complete check?
eg:
Personally I do not know the answer, but trusting the #id property will fail if another form registers itself with the id 'node-type' first.
Eg: http://drupal.org/files/issues/submenutree-349143-4-no-menu-fieldset-che...
compared with http://drupal.org/files/issues/submenutree-349143-patch-1.txt
Comment #6
bengtan commentedAh, I misread your first patch. Now I see you've used the same conditions as menu_form_alter().
The 'check on the form being processed' for both patches are more or less equivalent. I don't expect there to be a site out there which fails one but passes the other (and trying to predict this far is splitting straws too much, IMHO). Personally, I prefer the check against $form['#id'] because it is cleaner and because it is already in use.
> but trusting the #id property will fail if another form registers itself with the id 'node-type' first.
I think if another module registers a form with the id 'node-form', then large portions of node.module will break, so this is not likely to occur for a stable site.
So, overall, if my patch works for you and if you have no other objections, I'd go with it.
Comment #7
alan d. commentedAll good. I just had some concerns about a non-standard approach. But now this has two checks, #id and menu, so there should be very minimal risk. :)
Comment #8
bengtan commentedCommitted to cvs.
This fix will be incorporated into the next Submenutree release, whenever that is.
In the meanwhile, please patch your sites according to:
http://drupalcode.org/viewvc/drupal/contributions/modules/submenutree/su...
Thank you.