Commit 5b8375cd authored by Sebastien Robin's avatar Sebastien Robin

added a log when _aq_dynamic fails, this prevent from doing error on propertySheets


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@1817 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 5d3abbc3
...@@ -37,7 +37,6 @@ from Products.CMFCore.utils import getToolByName ...@@ -37,7 +37,6 @@ from Products.CMFCore.utils import getToolByName
from Products.DCWorkflow.Transitions import TRIGGER_WORKFLOW_METHOD from Products.DCWorkflow.Transitions import TRIGGER_WORKFLOW_METHOD
from Products.CMFActivity.ActiveObject import ActiveObject
from Products.ERP5Type import _dtmldir from Products.ERP5Type import _dtmldir
from Products.ERP5Type import PropertySheet from Products.ERP5Type import PropertySheet
...@@ -53,6 +52,7 @@ from ZopePatch import ERP5PropertyManager ...@@ -53,6 +52,7 @@ from ZopePatch import ERP5PropertyManager
from CopySupport import CopyContainer from CopySupport import CopyContainer
from Errors import DeferredCatalogError from Errors import DeferredCatalogError
from Products.CMFActivity.ActiveObject import ActiveObject
from string import join from string import join
import sys import sys
...@@ -202,7 +202,10 @@ class Base( CopyContainer, PortalContent, ActiveObject, ERP5PropertyManager ): ...@@ -202,7 +202,10 @@ class Base( CopyContainer, PortalContent, ActiveObject, ERP5PropertyManager ):
global aq_method_generated global aq_method_generated
klass = self.__class__ klass = self.__class__
if not aq_method_generated.has_key(klass): if not aq_method_generated.has_key(klass):
initializeDynamicProperties(self, klass) try:
initializeDynamicProperties(self, klass)
except:
LOG('_aq_dynamic',0,'error', error=sys.exc_info())
return getattr(self, id) return getattr(self, id)
return None return None
...@@ -945,6 +948,7 @@ class Base( CopyContainer, PortalContent, ActiveObject, ERP5PropertyManager ): ...@@ -945,6 +948,7 @@ class Base( CopyContainer, PortalContent, ActiveObject, ERP5PropertyManager ):
filter=None, portal_type=(), base=0): filter=None, portal_type=(), base=0):
self._getCategoryTool().setCategoryMembership(self, category, node_list, self._getCategoryTool().setCategoryMembership(self, category, node_list,
spec=spec, filter=filter, portal_type=portal_type, base=base) spec=spec, filter=filter, portal_type=portal_type, base=base)
self.activate().edit() # Do nothing except call workflow method
security.declareProtected( Permissions.ModifyPortalContent, 'setCategoryMembership' ) security.declareProtected( Permissions.ModifyPortalContent, 'setCategoryMembership' )
def setCategoryMembership(self, category, node_list, spec=(), base=0): def setCategoryMembership(self, category, node_list, spec=(), base=0):
...@@ -1495,6 +1499,14 @@ class Base( CopyContainer, PortalContent, ActiveObject, ERP5PropertyManager ): ...@@ -1495,6 +1499,14 @@ class Base( CopyContainer, PortalContent, ActiveObject, ERP5PropertyManager ):
# Compatibility with CMF Catalog / CPS sites # Compatibility with CMF Catalog / CPS sites
SearchableText = getSearchableText SearchableText = getSearchableText
security.declareProtected(Permissions.View, 'newError')
def newError(self, **kw):
"""
Create a new Error object
"""
from Products.ERP5Type.Error import Error
return Error(**kw)
InitializeClass(Base) InitializeClass(Base)
class TempBase(Base): class TempBase(Base):
......
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