Commit 7c0aee92 authored by Vincent Pelletier's avatar Vincent Pelletier

When query_table was explicitely given a None value, prevent joins from happening.

  Other uses in that function are None-safe:
   - first use checks that query_table exavuates to True before using
   - (this fix applied to the second use)
   - third use is to provide related keys with a query_tabe parameter. So when using a related key it is either meaningless (if related key ignores that parameter, it means that it hadcodes its "source" table) or fixable (by making related key handle a None query_table nicely, if not already the case).


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@24943 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a9675974
......@@ -2060,9 +2060,10 @@ class Catalog(Folder,
select_expression_list.extend(query_result['select_expression_list'])
# Calculate extra where_expression based on required joins
for k, tid in from_table_dict.items():
if k != query_table:
where_expression_list.append('%s.uid = %s.uid' % (query_table, tid))
if query_table:
for k, tid in from_table_dict.items():
if k != query_table:
where_expression_list.append('%s.uid = %s.uid' % (query_table, tid))
# Calculate extra where_expressions based on related definition
for (table_list, method_id) in related_methods.keys():
related_method = getattr(self, method_id, 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