Commit add3d05a authored by Yoshinori Okuji's avatar Yoshinori Okuji

Check if root is None in makeTreeList. Fix one more unicode bug.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@2973 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 1647c5c7
......@@ -178,7 +178,7 @@ def makeTreeList(here, form, root_dict, report_path, base_category, depth, unfol
else:
root = root_dict[None] = root_dict[base_category]
report_path = report_path[1:]
is_empty_level = (root.objectCount() == 0) and (len(report_path) != 0)
is_empty_level = (root is None or root.objectCount() == 0) and (len(report_path) != 0)
if is_empty_level: base_category = report_path[0]
tree_list = []
......@@ -963,6 +963,7 @@ class ListBoxWidget(Widget.Widget):
stat_context.domain_url = s[0].getRelativeUrl()
section_title = s[0].getTitle()
section_title = translate('content', section_title, section_title.decode('utf-8'))
if type(section_title) == type(u''):
section_title = section_title.encode('utf-8')
report_sections += [(s[0].getTitle(), 1, s[2], [stat_context], 1, s[3], s[4], stat_context, 0)]
# report id, is_summary, depth, object_list, object_list_len, XX, XX, report_object, start, stop
......@@ -1026,7 +1027,7 @@ class ListBoxWidget(Widget.Widget):
del kw['limit']
selection.edit( params = kw, report = None )
count = selection(method = count_method, context=here, REQUEST=REQUEST)
object_list_len = count[0][0]
object_list_len = int(count[0][0])
if start > object_list_len:
start = object_list_len
# For convenience, add padding into the list of objects with 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