Commit 682cdb5f authored by Jérome Perrin's avatar Jérome Perrin

Cleanup formulator internals fields when Base_callDialogMethod does not redirect.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@36105 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 3a0dc435
...@@ -259,14 +259,20 @@ url_params_string = make_query(clean_kw)\n ...@@ -259,14 +259,20 @@ url_params_string = make_query(clean_kw)\n
# If url is too long, we do not redirect to avoid crash.\n # If url is too long, we do not redirect to avoid crash.\n
# XXX: 2000 is an arbitrary value resulted from trial and error.\n # XXX: 2000 is an arbitrary value resulted from trial and error.\n
if (not(can_redirect) or len(url_params_string) > 2000):\n if (not(can_redirect) or len(url_params_string) > 2000):\n
# change the skin, unless we are executing the update action\n if dialog_method != update_method:\n
if dialog_method != update_method and \'portal_skin\' in clean_kw:\n # When we are not executing the update action, we have to change the skin\n
# manually,\n
if \'portal_skin\' in clean_kw:\n
new_skin_name = clean_kw[\'portal_skin\']\n new_skin_name = clean_kw[\'portal_skin\']\n
context.getPortalObject().portal_skins.changeSkin(new_skin_name)\n context.getPortalObject().portal_skins.changeSkin(new_skin_name)\n
request.set(\'portal_skin\', new_skin_name)\n request.set(\'portal_skin\', new_skin_name)\n
deferred_portal_skin = clean_kw.get(\'deferred_portal_skin\')\n deferred_portal_skin = clean_kw.get(\'deferred_portal_skin\')\n
if deferred_portal_skin:\n if deferred_portal_skin:\n
request.set(\'deferred_portal_skin\', deferred_portal_skin)\n request.set(\'deferred_portal_skin\', deferred_portal_skin)\n
# and to cleanup formulator\'s special key in request\n
for key in list(request.keys()):\n
if key.startswith(\'field\') or key.startswith(\'subfield\'):\n
request.form.pop(key, None)\n
\n \n
# If we cannot redirect, then call the form directly.\n # If we cannot redirect, then call the form directly.\n
dialog_form = getattr(context, dialog_method)\n dialog_form = getattr(context, dialog_method)\n
...@@ -393,6 +399,7 @@ return request.RESPONSE.redirect(redirect_url)\n ...@@ -393,6 +399,7 @@ return request.RESPONSE.redirect(redirect_url)\n
<string>url_params_string</string> <string>url_params_string</string>
<string>new_skin_name</string> <string>new_skin_name</string>
<string>deferred_portal_skin</string> <string>deferred_portal_skin</string>
<string>list</string>
<string>_apply_</string> <string>_apply_</string>
<string>redirect_url</string> <string>redirect_url</string>
</tuple> </tuple>
......
1601 1606
\ 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