Commit 6a927ed5 authored by Ayush Tiwari's avatar Ayush Tiwari Committed by Ayush Tiwari

bt5_config: Do not break any objects while loading CLass

parent 8eb190ae
...@@ -11,6 +11,7 @@ from Products.ERP5Type.Base import PropertyHolder, initializePortalTypeDynamicWo ...@@ -11,6 +11,7 @@ from Products.ERP5Type.Base import PropertyHolder, initializePortalTypeDynamicWo
from Products.ERP5Type.Utils import UpperCase from Products.ERP5Type.Utils import UpperCase
from Products.ERP5Type.Core.CategoryProperty import CategoryProperty from Products.ERP5Type.Core.CategoryProperty import CategoryProperty
from ExtensionClass import ExtensionClass, pmc_init_of from ExtensionClass import ExtensionClass, pmc_init_of
from Products.ERP5Type.Core.Folder import Folder
from zope.interface import classImplements from zope.interface import classImplements
from ZODB.broken import Broken, PersistentBroken from ZODB.broken import Broken, PersistentBroken
...@@ -333,7 +334,6 @@ class PortalTypeMetaClass(GhostBaseMetaClass, PropertyHolder): ...@@ -333,7 +334,6 @@ class PortalTypeMetaClass(GhostBaseMetaClass, PropertyHolder):
# Do not load the class again if it has already been loaded # Do not load the class again if it has already been loaded
if not cls.__isghost__: if not cls.__isghost__:
return return
# cls might be a subclass of a portal type class # cls might be a subclass of a portal type class
# we need to find the right class to change # we need to find the right class to change
for klass in cls.__mro__: for klass in cls.__mro__:
...@@ -354,7 +354,10 @@ class PortalTypeMetaClass(GhostBaseMetaClass, PropertyHolder): ...@@ -354,7 +354,10 @@ class PortalTypeMetaClass(GhostBaseMetaClass, PropertyHolder):
LOG("ERP5Type.Dynamic", WARNING, LOG("ERP5Type.Dynamic", WARNING,
"Could not access Portal Type Object for type %r" "Could not access Portal Type Object for type %r"
% portal_type, error=sys.exc_info()) % portal_type, error=sys.exc_info())
base_tuple = (ERP5BaseBroken, ) # XXX: Add checks for testing if this is just during import and that too
# for module objects only, for other cases, the base_tuple should be
# ERP5Broken only in general
base_tuple = (Folder,)
portal_type_category_list = [] portal_type_category_list = []
attribute_dict = dict(_categories=[], constraints=[]) attribute_dict = dict(_categories=[], constraints=[])
interface_list = [] interface_list = []
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment