Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

mod_admin: flush cached admin menu on module activate/deactivate.

  • Loading branch information...
commit db48a69391b3a85318246412d6f1e8fd2e73864c 1 parent 2665762
@kaos kaos authored
View
5 modules/mod_admin/mod_admin.erl
@@ -30,6 +30,7 @@
observe_sanitize_element/3,
observe_admin_menu/3,
observe_admin_edit_blocks/3,
+ observe_module_ready/2,
event/2,
do_link/5
@@ -136,6 +137,10 @@ observe_admin_edit_blocks(#admin_edit_blocks{}, Menu, Context) ->
].
+observe_module_ready(module_ready, Context) ->
+ z_depcache:flush(admin_menu, Context).
+
+
event(#postback_notify{message="admin-insert-block"}, Context) ->
Language = case z_context:get_q("language", Context) of
undefined ->
View
6 modules/mod_admin/models/m_admin_menu.erl
@@ -70,7 +70,11 @@ menu(Context) ->
Menu = z_notifier:foldl(admin_menu, [], Context),
hierarchize(Menu, Context)
end,
- z_depcache:memo(F, {admin_menu, z_acl:user(Context), z_context:language(Context)}, Context)
+ z_depcache:memo(F,
+ {admin_menu, z_acl:user(Context), z_context:language(Context)},
+ ?WEEK,
+ [admin_menu],
+ Context)
end.

2 comments on commit db48a69

@arjan
Owner

That's a real nice addition :D

@kaos
Owner

Yeah, I enabled mod_development, and wondered why I couldn't find the development page.... until i flushed the cache.. :p

Please sign in to comment.
Something went wrong with that request. Please try again.