Commit f25d64f1 authored by Tristan Cavelier's avatar Tristan Cavelier

erp5_core: hot fix selection issue polluting listbox selection

1. go to an organisation
2. click on its listbox title
3. go back to the organisation
4. click on a person in the listbox
5. go back to the organisation - the listbox results changed because of polluted selection
parent 3926a317
if REQUEST is None or form.getId() != "Base_viewListModeRenderer":
return "%s_%s_selection" % (form.getId(), field.getId())
request_selection_name = REQUEST.get("selection_name")
if request_selection_name:
selection_parameters = context.portal_selections.getSelectionParamsFor("%s_list_mode_proxy_selection" % request_selection_name)
else:
selection_parameters = {}
return "%s_%s_selection" % (
REQUEST.get("proxy_form_id") or
selection_parameters.get("proxy_form_id") or
form.getId(),
REQUEST.get("proxy_field_id") or
selection_parameters.get("proxy_field_id") or
field.getId(),
)
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>form, field, REQUEST=None</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_getViewModeListboxSelectionName</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -603,7 +603,7 @@ string:Base_viewListMode?proxy_form_id=${form/getId}&proxy_field_id=${field/getI ...@@ -603,7 +603,7 @@ string:Base_viewListMode?proxy_form_id=${form/getId}&proxy_field_id=${field/getI
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python: \'%s_%s_selection\' % (request.get("proxy_form_id") or context.portal_selections.getSelectionParamsFor(\'%s_list_mode_proxy_selection\' % context.REQUEST.get(\'selection_name\', \'\')).get(\'proxy_form_id\') or form.getId(), request.get("proxy_field_id") or context.portal_selections.getSelectionParamsFor(\'%s_list_mode_proxy_selection\' % context.REQUEST.get(\'selection_name\', \'\')).get(\'proxy_field_id\') or field.getId())</string> </value> <value> <string>python: context.Base_getViewModeListboxSelectionName(form=form, field=field, REQUEST=request)</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
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