Array to string conversion on line 296 in .../silverstripe/tagfield/src/StringTagField.php:
289 /**
290 * Ensure that arrays are imploded before being saved
291 *
292 * @return mixed|string
293 */
294 public function dataValue()
295 {
296 return implode(',', $this->value);
297 }
It appears $this->value is either a plain array, or an associative array of Title => Value pairs (when altered) at this point:
print_r($this->value) -> Array ( [0] => Array ( [Title] => one [Value] => one ) )
Seems looping over the items and using the 'Value' if defined, string item itself otherwise, fixes this:
public function dataValue()
{
// return implode(',', $this->value);
$values = [];
foreach($this->value as $string_or_assoc_array_value){
$values[] = is_array($string_or_assoc_array_value) ? $string_or_assoc_array_value['Value'] : $string_or_assoc_array_value;
}
return implode(',', $values);
}
If anyone can reproduce and this quick-fix seems acceptable, I'd be happy to create a PR for it.
Array to string conversion on line 296 in .../silverstripe/tagfield/src/StringTagField.php:
It appears
$this->valueis either a plain array, or an associative array of Title => Value pairs (when altered) at this point:print_r($this->value) -> Array ( [0] => Array ( [Title] => one [Value] => one ) )Seems looping over the items and using the 'Value' if defined, string item itself otherwise, fixes this:
If anyone can reproduce and this quick-fix seems acceptable, I'd be happy to create a PR for it.