If the string value is '' (empty string), the array
value should be [] (empty array), not [''] (array of one element
which is an empty string).
Bug: T169384
Change-Id: I558f3890af05efb6eaa18403467c0a05f44af12a
if ( !is_null( $value ) ) {
// $value is a string, but the widget expects an array
- $params['default'] = explode( "\n", $value );
+ $params['default'] = $value === '' ? [] : explode( "\n", $value );
}
// Make the field auto-infusable when it's used inside a legacy HTMLForm rather than OOUIHTMLForm