From 752cf9f3567831722780a041deaa84aa645695b6 Mon Sep 17 00:00:00 2001
From: Vincent Pelletier <vincent@nexedi.com>
Date: Mon, 27 Aug 2007 13:37:00 +0000
Subject: [PATCH] Volatile attributes are not stable any more at transaction
 scope with Zope 2.8, so better return the cache after initialisation than
 entrusting it to a volatile.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@15844 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Type/patches/CMFCoreSkinnable.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/product/ERP5Type/patches/CMFCoreSkinnable.py b/product/ERP5Type/patches/CMFCoreSkinnable.py
index 857d9b9439..b5fa9971e9 100644
--- a/product/ERP5Type/patches/CMFCoreSkinnable.py
+++ b/product/ERP5Type/patches/CMFCoreSkinnable.py
@@ -51,6 +51,7 @@ def CMFCoreSkinnableSkinnableObjectManager_initializeCache(self):
             'but does not exist.' % (skin_folder_id, ))
     skin_selection_mapping[selection_name] = skin_list
   portal_skins._v_skin_location_list = skin_selection_mapping
+  return skin_selection_mapping
 
 Skinnable.SkinnableObjectManager.initializeCache = CMFCoreSkinnableSkinnableObjectManager_initializeCache
 
@@ -73,8 +74,7 @@ def CMFCoreSkinnableSkinnableObjectManager___getattr__(self, name):
             skin_selection_mapping = portal_skins._v_skin_location_list
           except AttributeError:
             LOG('Skinnable Monkeypatch __getattr__', 0, 'Initial skin cache fill. This should not happen often. Current thread id:%X' % (get_ident(), ))
-            self.initializeCache()
-            skin_selection_mapping = portal_skins._v_skin_location_list
+            skin_selection_mapping = self.initializeCache()
           try:
             skin_folder_id = skin_selection_mapping[skin_selection_name][name]
           except KeyError:
-- 
2.30.9