Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
menu system
Priority:
Normal
Category:
Feature request
Assigned:
Issue tags:
Reporter:
Created:
24 Aug 2010 at 04:56 UTC
Updated:
29 Jul 2014 at 18:59 UTC
Jump to comment: Most recent file
Comments
Comment #1
Tor Arne Thune commentedStill a valid issue in Drupal 7.4. I'm not sure if this goes under string freeze or not, so not adding backport to D7 tag.
Comment #2
bleen commentedThis patch adds a new menu called "Footer Menu" and puts it in Bartik's footer region. I wasnt sure what default link(s) to put in there, so for now I just put a "home" link, but that is something to discuss. Also, I tweaked a function in Bartik's template.php to hide titles from blocks in the footer region like we do already in the header region. I think that the same assumption is valid.
Comment #3
sun#594660: Rename default menu names just landed.
We want to rename the internal menu name to just 'footer'.
There's a follow-up patch required in aforementioned issue though, which will prefix the system block identifiers with 'menu-'.
Comment #4
sunRe-rolled against HEAD and simplified interface texts.
Comment #5
shyamala commentedApplying patch throws up the below error
Comment #6
sun#4: drupal8.footer-menu.4.patch queued for re-testing.
Comment #7
sun@Shyamala: That's odd, sent the patch for re-testing, to prove what you're saying. In any case, please also double-check yourself that your local 8.x checkout is up to date.
Comment #8
sunComment #9
shyamala commentedThe patch applys. No error occurs, code updates well.
Is there anything else I need to do?
Comment #10
eric_a commented@Shyamala, have you run all database updates? A particularly interesting one is from this commit: http://drupalcode.org/project/drupal.git/commit/3666987
Comment #11
sunSo I thought about what would be a good use-case for a footer menu link in core, and came up with:
"Contact" :)
Attached patch adjusts Contact module accordingly, enables Contact module for the Standard installation profile, and also adds a database update for Menu module to inject the new menu into custom menus on existing sites (which is required to make it editable in the UI like all other menus).
Comment #12
sunThat said,
Contact module exposes the "Contact" menu link as a suggested item only. This means that the link is initially disabled.
We could change this item into a normal item, but that would get us into quite some scope-creep.
Instead, we adjust the Standard profile to enable it during installation.
Comment #13
sunIncorporated the suggestion from #12; i.e., Standard profile enables the Contact link in the Footer menu.
Apparently, the menu system does not provide a facility to do that yet, so I quickly had to invent one.
Comment #14
sunSmall adjustment to the menu update.
Comment #15
bleen commentedwhy doesn't this use the DBTNG syntax? ... I'm sure there is some coding standard that I'm just not familiar with, but I thought I'd ask just in case
Otherwise I love this patch ... applied cleanly and after a fresh install I had a contact link in my shiny new footer menu. RTBC from me
Comment #16
sunThe code is running a targeted query against the menu link table, which does not need the db_select() syntax. Also, the added query is using exactly the same approach as the existing
$op 'update'. If that was bogus, then it would have to be changed in a separate issue anyway. :)So I'm counting one RTBC here. Any further? :) Perhaps even an issue status change? ;)
Comment #17
barrapontoJust installed using
drush siand footer menu was there at the footer, but contact link was disabled.Comment #18
barrapontoI guess that's "Needs Work"
Comment #19
sun@barraponto: I'm relatively confident that Drush is not up to speed with regard to D8 at this point. At least, it does not work (more or less at all) for me.
Also, your review directly contradicts #15, which says that the link appeared just fine after performing a manual installation using Standard profile. Can you double-check? :)
Comment #20
barrapontoOk, I applied the patch from #14 (still applies cleanly) and manually installed using standard profile.
Still shows footer menu in the footer region, leaves contact link disabled :/
FWIW, I'm running PHP 5.4.8, MySQL 5.5.28 and Lighttpd 1.4.31. I'm using php-fpm (shouldn't matter).
Hmmm, is menu.inc loaded by the time standard_install runs?
Comment #21
sunAlright, sorry, confirmed your manual testing results, and fixed them:
Now the expectation is covered by automated tests. This is the first test for an installation profile in core, since testing of installation profiles was not possible before.
Comment #22
sunAlrighty:
Are we done? :)
Comment #23
barrapontoConfirm menu contact link is there after installation, even for anonymous users. Are we sure we want to leave this open by default, for possible abuse by spammer bots?
btw, I didn't read the installation profile test stuff (don't know simpletest). leaving it "needs review" for someone else to read it. but good work sun :)
Comment #24
shyamala commentedVoila! It's works awesome.
The contact link on the footer showed up!
Comment #25
webchickThis sounds like a good idea, but it's a new feature, and thus subject to thresholds, which we are over atm. :(
Comment #26
catchWhy all the changes to menu_link_maintain() and not just menu_link_save() in the install profile?
Comment #27
sunContact module registers a "Contact" link already, which we are putting in the footer menu by default.
That's a suggested item though and thus not enabled by default. We do not want to create a duplicate Contact link in that menu.
In order to not create/save a duplicate menu link, the existing menu link needs to be known and loaded, and it must be passed along to
menu_link_save(), so that the existing mlid and plid is known and the existing link can be updated. The menu [link] system does not provide API functions for that.However, the menu link system provides an API function that generally has the exact purpose of allowing code (not humans) to maintain a menu link: menu_link_maintain()
The important detail about it is that it only touches a menu link if it hasn't been customized. So this is exactly the API function that is needed, but it didn't support enable/disable operations yet. This patch here adds that tweak, so Standard profile can enable the default "Contact" link in a one-liner.
Comment #28
sun#21: platform.footer.21.patch queued for re-testing.
Comment #30
sunMerged HEAD.
Comment #31
sun#30: platform.footer.30.patch queued for re-testing.
Comment #32
catchI don't really like suggested items or menu_link_maintain() very much, but this patch isn't responsible for either of those so it's not really fair to hold it up on it.
I do think a new menu makes some sense and contact is a good use-case for it. I could see legal module adding a link there by default too.
Committed/pushed to 8.x. Could use a change notice.
Comment #33
sunThank you! :)
Change notice: http://drupal.org/node/1845756
Comment #35
mr.baileysFollow-up: Contact module still has some help text referring to the Contact-link being in the Tools-menu: #1873416: Contact module help text incorrect.