Commit fbb38971 by Romain Courteaud

[erp5_ingestion] Do not use absolute URL parameter

This is not compatible with ERP5JS
1 parent 5922a852
......@@ -90,7 +90,7 @@ else:
message = translateString('${portal_type} updated successfully.',
mapping=dict(portal_type=document_portal_type))
if redirect_to_document or redirect_url is not None:
if redirect_to_context or redirect_to_document or redirect_url is not None:
# this is an UI mode where script should handle HTTP redirects and is likely used
# by ERP5 form
if redirect_to_document and document is not None:
......@@ -103,6 +103,10 @@ if redirect_to_document or redirect_url is not None:
redirect_url= '%s?%s' %(redirect_url,
make_query(dict(portal_status_message=message)))
return context.REQUEST.RESPONSE.redirect(redirect_url)
elif redirect_to_context:
# explicitly required to view ingested document
return context.Base_redirect('view',
keep_items={'portal_status_message': message})
# return document (for non UI mode)
return document
......@@ -50,7 +50,7 @@
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>file=None, url=None, portal_type=None, classification=None, synchronous_metadata_discovery=None, redirect_to_document=None, attach_document_to_context=False, use_context_for_container=False, redirect_url=None, cancel_url=None, batch_mode=False, max_repeat=0, editable_mode = 1, follow_up_list=None, user_login=None, group=None, publication_section=None, **kw</string> </value>
<value> <string>file=None, url=None, portal_type=None, classification=None, synchronous_metadata_discovery=None, redirect_to_document=None, attach_document_to_context=False, use_context_for_container=False, redirect_url=None, redirect_to_context=False, cancel_url=None, batch_mode=False, max_repeat=0, editable_mode = 1, follow_up_list=None, user_login=None, group=None, publication_section=None, **kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
......@@ -96,7 +96,7 @@
<string>your_classification</string>
<string>your_portal_type</string>
<string>your_file</string>
<string>your_redirect_url</string>
<string>your_redirect_to_context</string>
</list>
</value>
</item>
......
......@@ -10,15 +10,16 @@
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>css_class</string>
<string>title</string>
<string>default</string>
<string>css_class</string>
<string>hidden</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_redirect_url</string> </value>
<value> <string>your_redirect_to_context</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......@@ -43,10 +44,6 @@
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
......@@ -55,16 +52,6 @@
<value>
<dictionary>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
......@@ -72,14 +59,6 @@
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
......@@ -93,11 +72,11 @@
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_string_field</string> </value>
<value> <string>my_checkbox</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
......@@ -108,8 +87,8 @@
<value> <int>1</int> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
<key> <string>title</string> </key>
<value> <string>Redirect</string> </value>
</item>
</dictionary>
</value>
......@@ -117,20 +96,4 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>here/absolute_url</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!