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,6 +1201,10 @@ class CategoryTool( UniqueObject, Folder, Base ):
portal_type = [portal_type]
if spec is (): spec = None # We do not want to care about spec
# Base Category may not be related, besides sub categories
if context.getPortalType() == 'Base Category':
category_list = [context.getRelativeUrl()]
else:
if type(base_category_list) is type('a'):
base_category_list = [base_category_list]
elif base_category_list is () or base_category_list is None:
......@@ -1208,7 +1212,7 @@ class CategoryTool( UniqueObject, Folder, Base ):
category_list = []
#LOG('getRelatedValueList',0,'base_category_list: %s' % str(base_category_list))
for base_category in base_category_list:
category_list += ["%s/%s" % (base_category, context.getRelativeUrl())]
category_list.append("%s/%s" % (base_category, context.getRelativeUrl()))
brain_result = self.Base_zSearchRelatedObjectsByCategoryList(category_list = category_list,
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