Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
In 6.x, we now have this lovely "Menu settings" thing right at the top of the form so that you can add your "About" link _right there_ as you create your "About" us page. Awesome!
But, the menu's Parent item defaults to "<Navigation>", that awful, ugly, mess of a menu with a mish-mash of every last module's left-over crap. That's not nice! Let's default it to "<Primary Links>" instead, which the admin has a lot more control over, and in 99.9% of the cases, is probably where they want to put that page anyway.
Comment | File | Size | Author |
---|---|---|---|
#10 | menu-default.patch | 1.96 KB | Jody Lynn |
#8 | menu-default.patch | 1.97 KB | Jody Lynn |
#4 | menu-default-pl-2.patch | 1.08 KB | Jody Lynn |
Comments
Comment #1
patchnewbie CreditAttribution: patchnewbie commentedThis would be a good patch for someone new to Drupal.
Comment #2
RobLoachIs webchick's secret identity "patchnewbie"?!
Comment #3
webchickHaha, yeah. It's my way of "tagging" issues for new people. :P
Comment #4
Jody LynnI removed variable_get('menu_default_node_menu', 'navigation') because the variable is set in system.install system_update_6021() where I'd be afraid to change it.
Comment #5
webernet CreditAttribution: webernet commentedI'm tempted to 'won't fix' this since it's configurable at /admin/build/menu/settings
Comment #6
Jody LynnThat's true, but maybe it should be set to 'primary links' by default as that configuration?
Comment #7
webchick@webernet: Yes, of course it is. But that value should default to Primary links, not Navigation. It's just one other stupid step that 99% of people need to do to setup their Drupal site. If someone really wants to dump _more_ links into Navigation, they can go there and switch it. :)
@Lynn: Thanks for this patch!! A couple of comments:
1. This is pretty close, but not quite what we're after. This code:
...means, "Go and find a variable called 'menu_default_node_menu', which is set from a settings page (in this case, admin/build/menu/settings). If you find it, go get that value. If not, default it to 'navigation'."
So rather than do this, which would hard-code $menu_name to _always_ be 'primary-links':
Let's try something like this instead, so that it defaults to the proper menu, but is still configurable from the settings page:
You'll want to search for other places where that menu_default_node_menu is and change them accordingly, too.
2. When you create patches, you should do it from the "root" of your Drupal installation (the same directory that has index.php, INSTALL.txt, etc. in it). This just makes it a little easier for people to try it out.
Hope that helps!
Comment #8
Jody LynnOk - I am making the patches with Textmate, so I'm trying to get the hang of making the right the modifications to them to make them right. I think I have this one now from root right, but now I had to patch two files so I just pasted the two patches together (is there more to it?)
Comment #9
webchickI get this trying to apply the patch:
Not quite... two problems....
First is the hunk FAILED stuff. This means that it couldn't find the line it's supposed to change anymore. What happened was someone fixed an indenting problem there in another patch which affected the same line you're trying to change, so it couldn't find the right line anymore.
When you get this, it means that the version of Drupal you're trying to patch is not quite up to date. The best thing to do is to check out Drupal from CVS and do your patching from there. Check out http://drupal.org/node/320 for more info.
If that's not an option, the latest copy of the 6.x dev tarball usually works as well.
The second problem is the "patch unexpectedly ends in middle of line." This is caused by the blank line in between:
and:
Unfortunately, I don't have TextMate, so I'm not sure why on earth it's generating patches like that. I sense that you had to generate one patch per file and then manually piece them together. That's too bad if it doesn't have an option to roll one patch for the entire thing, because that sounds very inconvenient. :(
How I would do this from the command prompt is:
However!
That said, I manually fixed the line in question and tried your changes and looks like it's working great! So just do a re-roll of this sucker and it should be ready to go. :)
Comment #10
Jody LynnThanks for all the help webchick! New patch.
Comment #11
blackdog CreditAttribution: blackdog commentedLast patch looks good, applies cleanly and works great.
Comment #12
Gábor HojtsyAgreed, committed, thanks.
Comment #13
(not verified) CreditAttribution: commentedAutomatically closed -- issue fixed for two weeks with no activity.