Commit 0f162102 authored by Xiaowu Zhang's avatar Xiaowu Zhang

SelectionTool: Don't rely on view when redirect

Consider that view is the default is wrong, we should invoke call on the object, this change fix listboxes used on frontpage of a website.
parent b01ef532
......@@ -223,7 +223,9 @@ class SelectionTool( BaseTool, SimpleItem ):
warnings.warn('DEPRECATED: _redirectToOriginalForm got called with a query_string. The variables must be passed in REQUEST.form.',
DeprecationWarning)
context = REQUEST['PARENTS'][0]
form_id = dialog_id or REQUEST.get('dialog_id', None) or form_id or REQUEST.get('form_id', 'view')
form_id = dialog_id or REQUEST.get('dialog_id', None) or form_id or REQUEST.get('form_id', None)
if form_id is None:
return context()
return getattr(context, form_id)()
security.declareProtected(ERP5Permissions.View, 'getSelectionNameList')
......
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