diff --git a/product/ERP5Type/CopySupport.py b/product/ERP5Type/CopySupport.py index 04557720ac9b89838f947e0e50ee5929ec588930..a04ac353bc7dbae89d4aa08391f0a7215de4b6f6 100644 --- a/product/ERP5Type/CopySupport.py +++ b/product/ERP5Type/CopySupport.py @@ -116,8 +116,9 @@ class CopyContainer: category_list = object.getCategoryList() path_len = len(path_item_list) for position in xrange(len(category_list)): - category_name = category_list[position].split('/') - if category_name[1:path_len + 1] == path_item_list: # XXX Should be possible to do this in a cleaner way + # only need to compare the first path_len components after the portal + category_name = category_list[position].split('/', path_len+1) + if category_name[1:path_len + 1] == path_item_list: category_name[path_len] = new_id category_list[position] = '/'.join(category_name) changed = True