If there was no schema type specified, TypedConfigManager will introspect the data type and assign a 'string' type if there was no type specified and the value was a string. This is dangerous for various reasons.
The following file would pass validation if only 'key' is defined but 'foo' is not: (A)
key: 'aa' foo: 'bb'
The following files would not pass schema validation under the same conditions: (B)
key: 'aa' foo: 123
key: 'aa' foo: - 'bb'
This is IMHO *extremely* confusing. While having a default type for string values sounds good, all other values get 'undefined' as their type and not introspected. What makes it worse is even if the data structure in C is what the module expects, A would still pass validation, so it would appear to the config schema system the file is correct. So if certain things are not defined, it somehow they get string values, they will always pass validation even if they should never be strings but an int checkbox value for example.
1. Remove the data introspection based default type assignment for strings.
2. Fix schemas to say type: string for the ones where it was missing. Probably plenty.
User interface changes
Type is now required even for strings. Defining a key without a type will be still undefined type.
|#6||interdiff.txt||4.84 KB||Gábor Hojtsy|
|#6||no-assume-type-config-schema-6.patch||5.7 KB||Gábor Hojtsy|
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 71,243 pass(es). View
|no-assume-type-config-schema.patch||883 bytes||Gábor Hojtsy|
FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] 71,242 pass(es), 333 fail(s), and 0 exception(s). View