Commit ad2c91be authored by Yoshinori Okuji's avatar Yoshinori Okuji

getRelatedValueList must deal with a base category.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@4092 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent bfb813e5
...@@ -1201,14 +1201,18 @@ class CategoryTool( UniqueObject, Folder, Base ): ...@@ -1201,14 +1201,18 @@ class CategoryTool( UniqueObject, Folder, Base ):
portal_type = [portal_type] portal_type = [portal_type]
if spec is (): spec = None # We do not want to care about spec if spec is (): spec = None # We do not want to care about spec
if type(base_category_list) is type('a'): # Base Category may not be related, besides sub categories
base_category_list = [base_category_list] if context.getPortalType() == 'Base Category':
elif base_category_list is () or base_category_list is None: category_list = [context.getRelativeUrl()]
base_category_list = self.getBaseCategoryList() else:
category_list = [] if type(base_category_list) is type('a'):
#LOG('getRelatedValueList',0,'base_category_list: %s' % str(base_category_list)) base_category_list = [base_category_list]
for base_category in base_category_list: elif base_category_list is () or base_category_list is None:
category_list += ["%s/%s" % (base_category, context.getRelativeUrl())] base_category_list = self.getBaseCategoryList()
category_list = []
#LOG('getRelatedValueList',0,'base_category_list: %s' % str(base_category_list))
for base_category in base_category_list:
category_list.append("%s/%s" % (base_category, context.getRelativeUrl()))
brain_result = self.Base_zSearchRelatedObjectsByCategoryList(category_list = category_list, brain_result = self.Base_zSearchRelatedObjectsByCategoryList(category_list = category_list,
portal_type = portal_type, portal_type = portal_type,
......
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