Skip to content

Commit

Permalink
Add workaround for autocomplete widget with imploded storage
Browse files Browse the repository at this point in the history
  • Loading branch information
flack committed Nov 15, 2023
1 parent be610c4 commit 3593e91
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,12 @@ public function transform($input)
if (!is_string($input) || substr($input, 1, -1) == '') {
return [];
}

return explode($this->multiple_separator, substr($input, 1, -1));
$results = explode($this->multiple_separator, substr($input, 1, -1));
if ( !empty($this->config['widget_config']['id_field'])
&& $this->config['widget_config']['id_field'] == 'id') {
$results = array_map('intval', $results);
}
return $results;

default:
throw new midcom_error("The multiple_storagemode '{$this->multiple_storagemode}' is invalid, cannot continue.");
Expand Down

0 comments on commit 3593e91

Please sign in to comment.