Closed (fixed)
Project:
Drupal core
Component:
locale.module
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Anonymous (not verified)
Created:
5 Oct 2004 at 18:00 UTC
Updated:
11 Dec 2004 at 10:15 UTC
Jump to comment: Most recent file
Comments
Comment #1
killes@www.drop.org commentedHere is a patch.
Comment #2
dries commentedCommitted to HEAD. Shouldn't we do the same after a string has been translated through the web interface? A small code comment wouldn't hurt.
Comment #3
dries commentedAnother related bug: when a user changes his or her locale setting from the 'my account' page, his or her cached menu does not appear to be invalidated. The menus are in the previously selected language.
Comment #4
killes@www.drop.org commentedThe attached patch addresses all the mentioned issues and also converts a few " to '.
Comment #5
dries commentedCommitted to HEAD.
Comment #6
puregin commentedIn book.module (4.5.0-rc) the book menu is not updated when changes to the structure of
a book occur and caching is enabled.
The attached patch calls cache_clear_all() and menu_rebuild() for each change which changes
book outlines.
Comment #7
(not verified) commentedThe book menu is not generated using the menu system, but internally by book.module. Therefore, the unchanging results you're seeing are a result of page caching only and have nothing to do with menu caching. In your fix, you should just use a cache_clear_all (only)... no need for a menu_rebuild.
Comment #8
puregin commentedbook_menu() is called with $may_cache, which if unset causes the book menu to not be
updated with changes to the book outline. I have tried removing the menu_rebuild() calls,
keeping only cache_clear_all(), and changes to books do not result in updates to the menu.
Am I missing something?
Comment #9
(not verified) commentedAt first, I thought you were referring to the block generated by book.module as the "book menu." After looking at the code, I see that you're referring to the book administration pages and that they are indeed cached. Sorry... my mistake.
Comment #10
moshe weitzman commentedI think a menu_rebuild() is a reasonable solution. An alternative would be to move the definition of those menu items into !$may_cache but that will cause unnecessary queries on pages viewed by node admins. onte that menu_rebuild() does a cache_clear_all() so you don't need both of those calls.
i think that these book outline links should be defined as MENU_DYNAMIC_ITEM.
Comment #11
dries commentedI did not apply the patch and moved the logic to the $may_cache clause and added some checks. I think that is the most performant behavior.
Comment #12
(not verified) commentedComment #13
gábor hojtsyThere is still some issues with locale module and menu caching. If I change the default locale on the locale admin interface, the menu cache should be invalidated. The locale cache could probably be kept intact, since it is per language. But since the default locale change is done after the menu items are collected and even the page help is computed, to not require another submit or page refresh, Drupal should issue a redirect after invalidating the menu cache, so I get the new language view instantly after changing the default language.
Lacking experience in how the redirect wizardry is done currently, I am afraid I am unable to provide a patch, although this would be nice to fix before 4.5.1.
Comment #14
dries commentedI committed a fix for this to both HEAD and DRUPAL-4-5. Thanks Goba. Marking this fixed.
Comment #15
(not verified) commented