IntegerOrToken silently truncates float inputs to integers
Problem/Motivation
Comprehensive ECA 3.1.x code review (2026-08-17) found data loss on float values assigned to integer-or-token config keys.
src/Plugin/DataType/IntegerOrToken.php:28-31 getCastedValue():
if (is_string($this->value) && $this->value !== '' && !is_numeric($this->value)) {
return $this->value;
}
return (int) $this->value;is_numeric("1.5") is TRUE, so the guard is skipped and the value is cast (int)"1.5" = 1.
alterSchemaFieldType retypes every integer and weight schema key to eca_integer_or_token, so a site builder entering 1.5 into a weight, cron, delay or integer field has it silently stored as 1. A float that core previously rejected (Range/type) is now silently corrupted.
Proposed resolution
Match integer semantics: pass through any string that is not a clean integer before casting, e.g.
if (is_string($this->value) && $this->value !== '' && filter_var($this->value, FILTER_VALIDATE_INT) === FALSE) {
return $this->value;
}reusing the same rule as EcaIntegerOrTokenConstraintValidator. Add a regression test for "1.5" on an eca_integer_or_token key.