From a81191e1db5cf86c7b0ecbf82d401127508c02da Mon Sep 17 00:00:00 2001
From: Fabien Morin <fabien@nexedi.com>
Date: Thu, 4 Mar 2010 09:11:43 +0000
Subject: [PATCH] add web_site_id to the cache method id as an instance can
 have many web_sites using admin toolbar

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@33372 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../WebSection_getToolbarModuleItemList.xml               | 8 ++++++--
 bt5/erp5_web/bt/revision                                  | 2 +-
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web_widget_library/WebSection_getToolbarModuleItemList.xml b/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web_widget_library/WebSection_getToolbarModuleItemList.xml
index 8590ee5f40..588fd24869 100644
--- a/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web_widget_library/WebSection_getToolbarModuleItemList.xml
+++ b/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web_widget_library/WebSection_getToolbarModuleItemList.xml
@@ -64,6 +64,8 @@ if module_id_list is None:\n
 \n
 portal = context.getPortalObject()\n
 user = portal.portal_membership.getAuthenticatedMember().getUserName()\n
+web_site_id = getattr(context, \'getWebSiteValue\', None) is not None and \\\n
+    context.getWebSiteValue().getId()\n
 \n
 def getModuleItemList(user=None):\n
   gettext = portal.Localizer.erp5_ui.gettext\n
@@ -78,8 +80,8 @@ def getModuleItemList(user=None):\n
   item_list.sort(key=lambda x: x[0])\n
   return item_list\n
 \n
-getModuleItemList = CachingMethod(getModuleItemList,  \n
-  id=(\'WebSection_getToolbarModuleItemList\', portal.Localizer.get_selected_language(), portal.portal_url()),\n
+getModuleItemList = CachingMethod(getModuleItemList,\n
+  id=(\'WebSection_getToolbarModuleItemList\', portal.Localizer.get_selected_language(), portal.portal_url(), web_site_id),\n
       cache_factory=\'erp5_ui_short\')\n
 \n
 return getModuleItemList(user=user)\n
@@ -127,6 +129,8 @@ return getModuleItemList(user=user)\n
                             <string>context</string>
                             <string>portal</string>
                             <string>user</string>
+                            <string>getattr</string>
+                            <string>web_site_id</string>
                             <string>getModuleItemList</string>
                           </tuple>
                         </value>
diff --git a/bt5/erp5_web/bt/revision b/bt5/erp5_web/bt/revision
index da77ca67a5..a13b1ebe37 100644
--- a/bt5/erp5_web/bt/revision
+++ b/bt5/erp5_web/bt/revision
@@ -1 +1 @@
-912
\ No newline at end of file
+913
\ No newline at end of file
-- 
2.30.9