Commit 6ffabf67 authored by Kevin Deldycke's avatar Kevin Deldycke

Sort objects to remove in reverse order to delete leaf first in a tree

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@10928 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e8e949ec
......@@ -354,6 +354,7 @@ class BaseTemplateItem(Implicit, Persistent):
remove_dict = kw.get('remove_object_dict', {})
keys = self._objects.keys()
keys.sort()
keys.reverse()
# if you choose remove, the object and all its subobjects will be removed
# even if you choose backup or keep for subobjects
# it is same behaviour for backup_and_remove, all we be save
......@@ -4115,6 +4116,7 @@ Business Template is a set of definitions, such as skins, portal types and categ
if action == 'remove' or action == 'save_and_remove':
remove_object_dict[path] = action
object_to_update.pop(path)
# remove object from old business template
if len(remove_object_dict) > 0:
for item_name in installed_bt._item_name_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