Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workflow: CopyError during publishing #795 #340

Merged
merged 3 commits into from
Dec 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 11 additions & 13 deletions Products/zms/zmscontainerobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,30 +247,28 @@ def moveObjsToTrashcan(self, ids, REQUEST):
if self.meta_id == 'ZMSTrashcan':
return
trashcan = self.getTrashcan()
# Set deletion-date.
ids_copy = []
nodes = []
for id in ids:
try:
context = getattr(self, id)
context.del_uid = str(REQUEST.get('AUTHENTICATED_USER', None))
context.del_dt = standard.getDateTime( time.time())
ids_copy.append(id)
# Move (Cut & Paste).
children = [context]
[standard.triggerEvent(child,'beforeDeleteObjsEvt') for child in children]
cb_copy_data = _cb_decode(self.manage_cutObjects([id]))
trashcan.manage_pasteObjects(cb_copy_data=_cb_encode(cb_copy_data))
[standard.triggerEvent(child,'afterDeleteObjsEvt') for child in children]
nodes.extend(children)
except:
standard.writeBlock( self, "[moveObjsToTrashcan]: Attribute Error %s"%(id))
# Use only successfully tried ids
ids = ids_copy
# Move (Cut & Paste).
children = [getattr(self,x) for x in ids]
[standard.triggerEvent(child,'beforeDeleteObjsEvt') for child in children]
cb_copy_data = _cb_decode(self.manage_cutObjects(ids))
trashcan.manage_pasteObjects(cb_copy_data=_cb_encode(cb_copy_data))
# Synchronize search.
self.getCatalogAdapter().unindex_nodes(nodes=nodes)
# Trashcan: Sort-IDs and Garbage-Collection,
trashcan.normalizeSortIds()
trashcan.run_garbage_collection(forced=1)
# Synchronize search.
self.getCatalogAdapter().unindex_nodes(nodes=children)
# Sort-IDs.
self.normalizeSortIds()
[standard.triggerEvent(child,'afterDeleteObjsEvt') for child in children]


############################################################################
Expand Down
Loading