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.
looking at potential uses of hook_translated_menu_link_alter() I realized that we might have an easy performance patch for D6 and D7. It really seems pointless (and potentially a lot of extra overhead) to localize tabs or links that we will not be displayed.
Comment | File | Size | Author |
---|---|---|---|
#9 | 266596_remove_notice_messages-2-7.x.patch | 982 bytes | danillonunes |
#7 | 266596_remove_notice_messages-7.x.patch | 980 bytes | danillonunes |
#7 | 266596_remove_notice_messages-6.x.patch | 822 bytes | danillonunes |
#1 | menu-performance-266596-1.patch | 1.11 KB | pwolanin |
Comments
Comment #1
pwolanin CreditAttribution: pwolanin commentedThis (untested) patch is against D6, but should apply to D7 too.
Comment #2
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD.
Comment #3
pwolanin CreditAttribution: pwolanin commentedso I guess this is RTBC for 6.x too?
Comment #4
pwolanin CreditAttribution: pwolanin commentedComment #5
Gábor HojtsyCommitted to Drupal 6, thanks!
Comment #6
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #7
danillonunes CreditAttribution: danillonunes commentedAs I have PHP E_ALL errors enabled, this check keep showing me boring "Notice: Undefined index: access" messages on 7.x-dev. Cannot reproduce on 6.x-dev, but maybe is because there's no menu item without any "access" key. Anyway, I made a patch for both 7.x and 6.x.
Edit: Oh, sorry for a lot of patches attached... It's a bug with Filefield + Opera :-(.
Comment #8
bfroehle CreditAttribution: bfroehle commentedFor clarity, shouldn't that be
if( (A && B) || (C && D) !== FALSE )
not
if ( A && B || (C && D) !== FALSE )
Powered by Dreditor.
Comment #9
danillonunes CreditAttribution: danillonunes commentedI just figure out that I had an active module whose files has been deleted, so that's why "access" key doesn't exists. I don't know if Drupal normally try to deal with these edge cases - maybe deleting files without uninstalling a module can give a lot of other troubles too because is an non recommended pratice. Anyway, I rerolled the first patch with #8 suggestion.
Comment #10
pwolanin CreditAttribution: pwolanin commentedComment #11
kscheirer#9: 266596_remove_notice_messages-2-7.x.patch queued for re-testing.
Comment #13
mgiffordComment #14
rahul.shindeComment #15
rahul.shinde@mgifford, @kscheirer, @danillonunes I suppose the required changes are in the
DefaultMenuLinkTreeManipulators
class. Please help confirm this.Comment #16
piyuesh23 CreditAttribution: piyuesh23 commentedComment #17
piyuesh23 CreditAttribution: piyuesh23 commentedComment #18
pwolanin CreditAttribution: pwolanin commentedUse !empty() don't use array_key_exists()
Comment #19
pwolanin CreditAttribution: pwolanin commentedComment #20
pwolanin CreditAttribution: pwolanin commentedI also suspect this is no longer relevant for Drupal 8.0.x.
From \Drupal\Core\Menu\DefaultMenuLinkTreeManipulators::checkAccess()
Comment #21
Gábor Hojtsy