From 741b476508a7b4acccba4c6be0b9300762b22f08 Mon Sep 17 00:00:00 2001
From: Vincent Pelletier <vincent@nexedi.com>
Date: Thu, 27 Nov 2014 10:11:37 +0100
Subject: [PATCH] ERP5Type.patches.CMFCoreSkinnable: Fix getCurrentSkinName.

Patched class' getCurrentSkinName expects a 4-tuple, although it ignores
the first value, so provide a placeholder.
---
 product/ERP5Form/ProxyField.py               | 2 +-
 product/ERP5Type/Base.py                     | 2 +-
 product/ERP5Type/patches/CMFCoreSkinnable.py | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/product/ERP5Form/ProxyField.py b/product/ERP5Form/ProxyField.py
index a0b4022d38..970ebb25ac 100644
--- a/product/ERP5Form/ProxyField.py
+++ b/product/ERP5Form/ProxyField.py
@@ -456,7 +456,7 @@ class ProxyField(ZMIField):
           skin_info = SKINDATA.get(get_ident())
 
           if skin_info is not None:
-            skin_selection_name, ignore, resolve = skin_info
+            _, skin_selection_name, ignore, resolve = skin_info
 
             selection_dict = portal_skins._getSelections()
             candidate_folder_id_list = selection_dict[skin_selection_name].split(',')
diff --git a/product/ERP5Type/Base.py b/product/ERP5Type/Base.py
index b59bee2cec..1fd50c84e2 100644
--- a/product/ERP5Type/Base.py
+++ b/product/ERP5Type/Base.py
@@ -2948,7 +2948,7 @@ class Base( CopyContainer,
       skin_info = SKINDATA.get(thread.get_ident())
       if skin_info is not None:
         portal = self.getPortalObject()
-        object = skinResolve(portal, (skin_info[0], skin), id)
+        object = skinResolve(portal, (skin_info[1], skin), id)
         if object is not None:
           # First wrap at the portal to set the owner of the executing script.
           # This mimics the usual way to get an object from skin folders,
diff --git a/product/ERP5Type/patches/CMFCoreSkinnable.py b/product/ERP5Type/patches/CMFCoreSkinnable.py
index 994e8ea20b..fd918411f4 100644
--- a/product/ERP5Type/patches/CMFCoreSkinnable.py
+++ b/product/ERP5Type/patches/CMFCoreSkinnable.py
@@ -105,7 +105,7 @@ def CMFCoreSkinnableSkinnableObjectManager___getattr__(self, name):
   if name[:1] != '_' and name[:3] != 'aq_':
     skin_info = SKINDATA.get(get_ident())
     if skin_info is not None:
-      skin_selection_name, ignore, resolve = skin_info
+      _, skin_selection_name, ignore, resolve = skin_info
       try:
         return resolve[name]
       except KeyError:
@@ -133,7 +133,7 @@ def CMFCoreSkinnableSkinnableObjectManager_changeSkin(self, skinname, REQUEST=No
       if sf is not None:
         skinname = sf.getDefaultSkin()
   tid = get_ident()
-  SKINDATA[tid] = (skinname, {'portal_skins': None}, {})
+  SKINDATA[tid] = (None, skinname, {'portal_skins': None}, {})
   if REQUEST is None:
     REQUEST = getattr(self, 'REQUEST', None)
   if REQUEST is not None:
-- 
2.30.9