Commit 11d76d0d authored by Julien Muchembled's avatar Julien Muchembled
Browse files

Fix edit() for temporary objects created with Base.asContext

For other temporary objects, there may be interactions on edit(),
like Document_base_convertable_edit (document_conversion_interaction_workflow),
tested by test_02_VolatileCacheConversionOfTempObject (testOOoConversionCache).
parent e68fe7bb
......@@ -80,6 +80,14 @@ class TemporaryDocumentMixin(object):
def getTitle(self):
return getattr(self,'title',None)
def edit(self, *args, **kw):
if getattr(self, "_original", None) is None:
return super(TemporaryDocumentMixin, self).edit(*args, **kw)
# Object created with Base.asContext, so do not touch borrowed
# workflow history, in particular if it is persistent.
# This also avoids security issues.
return self._edit(restricted=1, *args, **kw)
# Make some methods public.
for method_id in ('reindexObject', 'recursiveReindexObject',
'activate', 'setUid', 'setTitle', 'getTitle',
......
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