Commit 4d94d63b authored by Yoshinori Okuji's avatar Yoshinori Okuji

Use an object id rather than a physical path, because this is not always reliable.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@13782 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent b3529b5f
...@@ -103,7 +103,7 @@ class ActiveObject(ExtensionClass.Base): ...@@ -103,7 +103,7 @@ class ActiveObject(ExtensionClass.Base):
# Get default parameters from a transactional variable. # Get default parameters from a transactional variable.
tv = getTransactionalVariable() tv = getTransactionalVariable()
key = ('default_activate_parameter', self.getPhysicalPath()) key = ('default_activate_parameter', id(aq_base(self)))
try: try:
for k, v in tv[key].iteritems(): for k, v in tv[key].iteritems():
if k not in kw: if k not in kw:
...@@ -194,5 +194,5 @@ class ActiveObject(ExtensionClass.Base): ...@@ -194,5 +194,5 @@ class ActiveObject(ExtensionClass.Base):
# This method sets the default keyword parameters to activate. This is useful # This method sets the default keyword parameters to activate. This is useful
# when you need to specify special parameters implicitly (e.g. to reindexObject). # when you need to specify special parameters implicitly (e.g. to reindexObject).
tv = getTransactionalVariable() tv = getTransactionalVariable()
key = ('default_activate_parameter', self.getPhysicalPath()) key = ('default_activate_parameter', id(aq_base(self)))
tv[key] = kw tv[key] = kw
\ No newline at end of file
...@@ -39,18 +39,19 @@ from zLOG import LOG ...@@ -39,18 +39,19 @@ from zLOG import LOG
manage_addActiveProcessForm=DTMLFile('dtml/ActiveProcess_add', globals()) manage_addActiveProcessForm=DTMLFile('dtml/ActiveProcess_add', globals())
def addActiveProcess( self, id, title='', REQUEST=None, activate_kw=None, **kw): def addActiveProcess(self, id, title='', REQUEST=None, activate_kw=None, **kw):
""" """
Add a new Category and generate UID by calling the Add a new Category and generate UID by calling the
ZSQLCatalog. This code is inspired from Document Constructor ZSQLCatalog. This code is inspired from Document Constructor
in Products.ERP5Type.Utils and should probably be merged. in Products.ERP5Type.Utils and should probably be merged.
""" """
o = ActiveProcess( id ) o = ActiveProcess(id)
if activate_kw is not None: if activate_kw is not None:
o.setDefaultActivateParameters(**activate_kw) o.setDefaultActivateParameters(**activate_kw)
o.uid = self.portal_catalog.newUid() o.uid = self.portal_catalog.newUid()
self._setObject( id, o ) self._setObject(id, o)
if kw: o.__of__(folder)._edit(force_update=1, **kw) o = self._getOb(id)
if kw: o._edit(force_update=1, **kw)
if REQUEST is not None: if REQUEST is not None:
REQUEST['RESPONSE'].redirect( 'manage_main' ) REQUEST['RESPONSE'].redirect( 'manage_main' )
......
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