Commit cbd339e9 authored by Romain Courteaud's avatar Romain Courteaud

Set parameter is_web_mode to 1 in the REQUEST before calling Base_edit.

This is usefull when fields use 'is_web_mode'  in a TALES expression

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@18855 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent b55f37c8
...@@ -3,11 +3,8 @@ ...@@ -3,11 +3,8 @@
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<tuple> <tuple>
<tuple> <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<string>Products.PythonScripts.PythonScript</string> <tuple/>
<string>PythonScript</string>
</tuple>
<none/>
</tuple> </tuple>
</pickle> </pickle>
<pickle> <pickle>
...@@ -73,9 +70,15 @@ ...@@ -73,9 +70,15 @@
The edit_document_url is used to define the URL to return to\n The edit_document_url is used to define the URL to return to\n
after editing the document.\n after editing the document.\n
"""\n """\n
\n
# This is required in case of field using \'is_web_mode\' in TALES expression\n
context.REQUEST.set(\'is_web_mode\', 1)\n
\n
# Retrieve the edit action\n # Retrieve the edit action\n
edit_method = getattr(context, form_action)\n edit_method = getattr(context, form_action)\n
return edit_method(form_id, editable_mode=editable_mode, ignore_layout=ignore_layout, **kw)\n return edit_method(form_id, editable_mode=editable_mode, \n
ignore_layout=ignore_layout, \n
**kw)\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -130,8 +133,9 @@ return edit_method(form_id, editable_mode=editable_mode, ignore_layout=ignore_la ...@@ -130,8 +133,9 @@ return edit_method(form_id, editable_mode=editable_mode, ignore_layout=ignore_la
<string>editable_mode</string> <string>editable_mode</string>
<string>ignore_layout</string> <string>ignore_layout</string>
<string>kw</string> <string>kw</string>
<string>getattr</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>getattr</string>
<string>edit_method</string> <string>edit_method</string>
<string>_apply_</string> <string>_apply_</string>
</tuple> </tuple>
......
...@@ -3,11 +3,8 @@ ...@@ -3,11 +3,8 @@
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<tuple> <tuple>
<tuple> <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<string>Products.PythonScripts.PythonScript</string> <tuple/>
<string>PythonScript</string>
</tuple>
<none/>
</tuple> </tuple>
</pickle> </pickle>
<pickle> <pickle>
...@@ -74,6 +71,10 @@ ...@@ -74,6 +71,10 @@
The view_document_url is used to define the URL to return to\n The view_document_url is used to define the URL to return to\n
after editing the document.\n after editing the document.\n
"""\n """\n
\n
# This is required in case of field using \'is_web_mode\' in TALES expression\n
context.REQUEST.set(\'is_web_mode\', 1)\n
\n
# Retrieve the edit action\n # Retrieve the edit action\n
edit_method = getattr(context, form_action)\n edit_method = getattr(context, form_action)\n
return edit_method(form_id, editable_mode=0, ignore_layout=ignore_layout, **kw)\n return edit_method(form_id, editable_mode=0, ignore_layout=ignore_layout, **kw)\n
...@@ -131,8 +132,9 @@ return edit_method(form_id, editable_mode=0, ignore_layout=ignore_layout, **kw)\ ...@@ -131,8 +132,9 @@ return edit_method(form_id, editable_mode=0, ignore_layout=ignore_layout, **kw)\
<string>editable_mode</string> <string>editable_mode</string>
<string>ignore_layout</string> <string>ignore_layout</string>
<string>kw</string> <string>kw</string>
<string>getattr</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>getattr</string>
<string>edit_method</string> <string>edit_method</string>
<string>_apply_</string> <string>_apply_</string>
</tuple> </tuple>
......
612 615
\ No newline at end of file \ 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