Commit 133d2102 authored by Jean-Paul Smets's avatar Jean-Paul Smets

Renaming an object ID now renames related predicates.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@18580 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 78f28ec3
......@@ -1293,12 +1293,41 @@ class CategoryTool( UniqueObject, Folder, Base ):
if getattr(aq_base(o),
'notifyAfterUpdateRelatedContent', None) is not None:
o.notifyAfterUpdateRelatedContent(previous_category_url,
new_category_url)
new_category_url) # XXX - wrong programming Approach
# for ERP5 - either use interaction
# workflows or interactors rather
# than creating notifyWhateverMethod
else:
LOG('CMFCategory', PROBLEM,
'updateRelatedContent: %s does not exist' % brain.path)
for brain in self.Base_zSearchRelatedObjectsByPredicate(
category_uid = context.getUid()):
o = brain.getObject()
if o is not None:
category_list = []
for category in self.getMembershipCriterionCategoryList(o):
new_category = self.updateRelatedCategory(category,
previous_category_url,
new_category_url)
category_list.append(new_category)
self._setMembershipCriterionCategoryList(o, category_list)
if getattr(aq_base(o),
'notifyAfterUpdateRelatedContent', None) is not None:
o.notifyAfterUpdateRelatedContent(previous_category_url,
new_category_url) # XXX - wrong programming Approach
# for ERP5 - either use interaction
# workflows or interactors rather
# than creating notifyWhateverMethod
else:
LOG('CMFCategory', PROBLEM,
'updateRelatedContent: %s does not exist' % brain.path)
aq_context = aq_base(context)
# Update related recursively if required
if getattr(aq_context, 'listFolderContents', None) is not None:
......
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