From c5268193342649b6c95fa4845e6b06b26c997c8b Mon Sep 17 00:00:00 2001
From: Ivan Tyagov <ivan@nexedi.com>
Date: Fri, 8 Sep 2017 13:51:48 +0300
Subject: [PATCH] A hotfix for ERP5 sites which do not yet have inside ZODB
 instance of portal_callables tool.

---
 product/ERP5Type/patches/CMFCoreSkinnable.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/product/ERP5Type/patches/CMFCoreSkinnable.py b/product/ERP5Type/patches/CMFCoreSkinnable.py
index 38e7efc388..cdbba4af1a 100644
--- a/product/ERP5Type/patches/CMFCoreSkinnable.py
+++ b/product/ERP5Type/patches/CMFCoreSkinnable.py
@@ -68,9 +68,13 @@ Skinnable.SkinnableObjectManager.initializeCache = CMFCoreSkinnableSkinnableObje
 def skinResolve(self, selection, name):
   try:
     portal_skins = aq_base(self.portal_skins)
-    portal_callables = aq_base(self.portal_callables)
   except AttributeError:
     raise AttributeError, name
+  try:
+    portal_callables = aq_base(self.portal_callables)
+  except AttributeError:
+    # backwards compatability for ERP5 sites without this tool
+    portal_callables = None
   try:
     skin_selection_mapping = portal_skins._v_skin_location_list
     reset = False
-- 
2.30.9