Commit 8439cd54 authored by Yoshinori Okuji's avatar Yoshinori Okuji

2008-05-21 yo

* Try an English version if no document is found for a given language.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@21071 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent dae35479
......@@ -3,11 +3,8 @@
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.PythonScripts.PythonScript</string>
<string>PythonScript</string>
</tuple>
<none/>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</pickle>
<pickle>
......@@ -110,23 +107,28 @@ web_page_list = portal_catalog(reference=name, portal_type=valid_portal_type_lis
group_by=(\'reference\',),\n
**kw)\n
\n
try:\n
# Try to get the first page on the list\n
web_page = web_page_list[0]\n
web_page = web_page.getObject()\n
except IndexError:\n
if len(web_page_list) == 0 and language != \'en\':\n
# Search again with English as a fallback.\n
web_page_list = portal_catalog(reference=name, portal_type=valid_portal_type_list,\n
language=\'en\',\n
order_by=[(\'version\', \'descending\')],\n
group_by=(\'reference\',),\n
**kw)\n
\n
if len(web_page_list) == 0:\n
# Search again without the language\n
web_page_list = portal_catalog(reference=name, portal_type=\'Web Page\', \n
order_by=[(\'version\', \'descending\')],\n
group_by=(\'reference\',),\n
**kw)\n
try:\n
# Try to get the first page on the list\n
web_page = web_page_list[0]\n
web_page = web_page.getObject()\n
except IndexError:\n
# Default returns None\n
web_page = None\n
\n
if len(web_page_list) == 0:\n
# Default returns None\n
web_page = None\n
else:\n
# Try to get the first page on the list\n
web_page = web_page_list[0]\n
web_page = web_page.getObject()\n
\n
# return the web page\n
return web_page\n
......@@ -191,8 +193,8 @@ return web_page\n
<string>_write_</string>
<string>_apply_</string>
<string>web_page_list</string>
<string>len</string>
<string>web_page</string>
<string>IndexError</string>
</tuple>
</value>
</item>
......
2008-05-21 yo
* Try an English version if no document is found for a given language.
2008-4-17 yusei
* Revise version to 5.0.
......
630
\ No newline at end of file
631
\ No newline at end of file
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