helper_user_search_criteria looks for the wrong criteria value in custom user fields

Affected version
2.1.2

DragonByte Tech

Well-known member
Given this code:
HTML:
<xf:set var="$fieldName" value="criteria[user_field]{{ ($choices && $fieldDefinition.type_group != 'multiple') ? '[exact]' : '' }}[{$fieldId}]" />
this means that a multi-select will be saved like so:

Code:
  ["user_field"] => array(1) {
    ["test_multi_select"] => array(1) {
      [0] => string(11) "s:5:"test1""
    }
  }
(Notice the lack of exact)

However, when later looking for the value:
HTML:
<xf:checkbox name="{$fieldName}" value="{$criteria.user_field.exact.{$fieldId}}" listclass="listColumns" readonly="{$readOnly}">
It always expect exact to exist, which will never be true for multi-selects.

Therefore, it is impossible to save criteria with a multi-select user field and load these criteria back into the form with the correct selection.
 
Top