- Affected version
- 2.0.3
If you have an entity column LIST_COMMA/LIST_LINES, with a list sub-type of integer, it will not round trip as expected.
This is because decodeValueFromSource ignores the sub-tyle information while applyValueConstraints applies it.
Column definition;
On the request setting:
returns:
On future requests (ie not loaded from cache)
returns:
Since decodeValueFromSource 's handling of LIST_COMMA/LIST_LINES is to use `explode()`, these will be string-types no integer types.
This is because decodeValueFromSource ignores the sub-tyle information while applyValueConstraints applies it.
Column definition;
PHP:
$structure->columns['extra_user_group_ids'] = ['type' => self::LIST_COMMA, 'default' => [],
'list' => ['type' => 'posint', 'unique' => true, 'sort' => SORT_NUMERIC]
]
On the request setting:
PHP:
$entity->extra_user_group_ids= [1,2,3,4];
var_dump($entity->extra_user_group_ids);
PHP:
array(4) {
[0] => int(1)
[1] => int(2)
[2] => int(3)
[3] =>int(4)
}
On future requests (ie not loaded from cache)
PHP:
var_dump($entity->extra_user_group_ids);
PHP:
array(4) {
[0] => string(1) "1"
[1] => string(1) "2"
[2] => string(1) "3"
[3] => string(1) "4"
}
Since decodeValueFromSource 's handling of LIST_COMMA/LIST_LINES is to use `explode()`, these will be string-types no integer types.