Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Cédric Le Ninivin
erp5
Commits
5e2b3bbd
Commit
5e2b3bbd
authored
May 12, 2023
by
Yusei Tahara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reduce rare AttributeError on Skins Tool.
Thanks to Vincent Pelletier for his help on this bug fix.
parent
e274b020
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
product/ERP5Type/patches/CMFCoreSkinnable.py
product/ERP5Type/patches/CMFCoreSkinnable.py
+10
-2
No files found.
product/ERP5Type/patches/CMFCoreSkinnable.py
View file @
5e2b3bbd
...
@@ -20,6 +20,7 @@ from _thread import get_ident
...
@@ -20,6 +20,7 @@ from _thread import get_ident
from
zLOG
import
LOG
,
WARNING
,
DEBUG
from
zLOG
import
LOG
,
WARNING
,
DEBUG
from
Acquisition
import
aq_base
from
Acquisition
import
aq_base
import
six
import
six
import
random
"""
"""
This patch modifies the way CMF Portal Skins gets a skin by its name from
This patch modifies the way CMF Portal Skins gets a skin by its name from
...
@@ -148,7 +149,12 @@ def CMFCoreSkinnableSkinnableObjectManager_changeSkin(self, skinname, REQUEST=No
...
@@ -148,7 +149,12 @@ def CMFCoreSkinnableSkinnableObjectManager_changeSkin(self, skinname, REQUEST=No
skinname
=
sf
.
getDefaultSkin
()
skinname
=
sf
.
getDefaultSkin
()
tid
=
get_ident
()
tid
=
get_ident
()
SKINDATA
[
tid
]
=
(
SKINDATA
[
tid
]
=
(
None
,
# CMFCore uses the first item of this tuple, but ERP5 did not.
# Thus we put a random value here to reduce rare AttributeError
# caused by wrong SKINDATA deletion. See SkinDataCleanup.hashSkinData.
# However, it is not enough. To eliminate rare AttributeError bug,
# we have to stop using global SKINDATA dict completely.
random
.
getrandbits
(
24
),
skinname
,
skinname
,
{
'portal_skins'
:
None
,
'portal_callables'
:
None
},
{
'portal_skins'
:
None
,
'portal_callables'
:
None
},
{})
{})
...
@@ -207,5 +213,7 @@ class SkinDataCleanup:
...
@@ -207,5 +213,7 @@ class SkinDataCleanup:
pass
pass
def
hashSkinData
(
self
,
skindata
):
def
hashSkinData
(
self
,
skindata
):
return
id
(
skindata
)
# id() might return the same value even though object is different.
# thus use a random value additionally.
return
(
id
(
skindata
),
skindata
[
0
])
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment