Commit d05c9d7d authored by Sebastien Robin's avatar Sebastien Robin

disable the guessed_base_category check


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@2818 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 559e30ed
......@@ -141,23 +141,23 @@ class Renderer(Filter):
# If base=1 but base_category is None, it is necessary to guess the base category
# by heuristic.
if self.base and self.base_category is None:
base_category_count_map = {}
for value in value_list:
if not getattr(value, 'isCategory', 0):
continue
b = value.getBaseCategoryId()
if b in base_category_count_map:
base_category_count_map[b] += 1
else:
base_category_count_map[b] = 1
guessed_base_category = None
max_count = 0
for k,v in base_category_count_map.items():
if v > max_count:
guessed_base_category = k
max_count = v
LOG('render', 100, repr(guessed_base_category))
# if self.base and self.base_category is None:
# base_category_count_map = {}
# for value in value_list:
# if not getattr(value, 'isCategory', 0):
# continue
# b = value.getBaseCategoryId()
# if b in base_category_count_map:
# base_category_count_map[b] += 1
# else:
# base_category_count_map[b] = 1
# guessed_base_category = None
# max_count = 0
# for k,v in base_category_count_map.items():
# if v > max_count:
# guessed_base_category = k
# max_count = v
# LOG('render', 100, repr(guessed_base_category))
# Initialize the list of items.
item_list = []
......@@ -199,10 +199,13 @@ class Renderer(Filter):
else:
# If the base category of this category does not match the guessed base category,
# merely ignore this category.
# This is not the job for a Renderer to automatically remove values if we don not
# specify a filter
if not hasattr(value, 'getBaseCategoryId'):
continue
if value.getBaseCategoryId() != guessed_base_category:
continue
# Remove from now, it might be outdated and useless
#if value.getBaseCategoryId() != guessed_base_category:
# continue
else:
if self.base_category:
# Nothing to do.
......
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