Commit ea784a3b authored by Vincent Pelletier's avatar Vincent Pelletier

erp5_web: Use "limit" so sort is applied before projection.

As this means sorting had no effect, drop sorting on versions: versions
are arbitrary strings which can have any evolution scheme, so do not try
to guess what is more recent than something else.
parent 232ea9c4
......@@ -91,8 +91,8 @@ web_page_list = portal_catalog(reference=name,\n
portal_type=valid_portal_type_list,\n
validation_state=validation_state,\n
language=(language, \'\'),\n
sort_on=[(\'language\', \'descending\'), (\'version\', \'descending\')],\n
group_by=(\'reference\',),\n
sort_on=[(\'language\', \'descending\'), ],\n
limit=1,\n
**kw)\n
\n
if len(web_page_list) == 0 and language != \'en\':\n
......@@ -101,8 +101,7 @@ if len(web_page_list) == 0 and language != \'en\':\n
portal_type=valid_portal_type_list,\n
validation_state=validation_state,\n
language=\'en\',\n
sort_on=[(\'version\', \'descending\')],\n
group_by=(\'reference\',),\n
limit=1,\n
**kw)\n
\n
if len(web_page_list) == 0:\n
......@@ -110,8 +109,7 @@ if len(web_page_list) == 0:\n
web_page_list = portal_catalog(reference=name,\n
portal_type=valid_portal_type_list,\n
validation_state=validation_state,\n
sort_on=[(\'version\', \'descending\')],\n
group_by=(\'reference\',),\n
limit=1,\n
**kw)\n
\n
if len(web_page_list) == 0:\n
......
1109
\ No newline at end of file
1110
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