Follow-up from #1653026: [META] Use properly typed values in module configuration.
EDIT: (see comment #13) Postoned on #2130811: Use config schema in saving and validating configuration form to ensure data is consistent and correct .
Then this issue should deal with all field config shipped in core and also ensure
that the schemas are correct too.
Problem/Motivation
All integers, Booleans, and even octal numbers in config object files are converted to strings.
Proposed resolution
#1653026: [META] Use properly typed values in module configuration has fixed core, so no need to convert all data types to string anymore.
Remaining tasks
Fix and issue patch for below config files:
field.settings.yml
field.field.entity_test.field_test_import.yml
field.field.entity_test.field_test_import_2.yml
field.instance.entity_test.entity_test.field_test_import.yml
field.instance.entity_test.entity_test.field_test_import_2.yml
field.instance.entity_test.test_bundle.field_test_import_2.yml
field.field.entity_test.field_test_import_staging.yml
field.field.entity_test.field_test_import_staging_2.yml
field.instance.entity_test.entity_test.field_test_import_staging.yml
field.instance.entity_test.test_bundle.field_test_import_staging_2.yml
field.instance.entity_test.test_bundle_2.field_test_import_staging_2.yml
views.view.test_view_fieldapi.yml
User interface changes
NO
API changes
NO
Related Issues
Parent: #1653026: [META] Use properly typed values in module configuration
Comment | File | Size | Author |
---|---|---|---|
#5 | 2105951-5.patch | 9.14 KB | sidharthap |
#3 | 2105951-3.patch | 11.7 KB | sidharthap |
#1 | 2105951-1.patch | 9.26 KB | sidharthap |
Comments
Comment #1
sidharthapinitial patch file.
Comment #2
yched CreditAttribution: yched commentedshould stay as 1 (the number)
(same in other field.field.* files)
What ?? We still have a 'widget' section in there ? It should be removed altogether, it's not relevant anymore.
(same in other field.instance.* files)
Comment #3
sidharthapThank you @yched.
Here is the corrected patch file.
Comment #4
yched CreditAttribution: yched commentedLooks like this doesn't belong here ? :-)
Comment #5
sidharthapoops!
The corrected patch.
Comment #6
yched CreditAttribution: yched commentedLooks good. Thanks !
Comment #7
yched CreditAttribution: yched commentedComment #8
alexpottSo doing this only makes sense if we save the files in the same way the API does... I've just created a text field through the ui
field.field.node.field_textfield.yml looks like this
field.instance.node.article.field_textfield.yml looks like this
It looks like we're going to have to do some casting in the form submit handlers in the UI
Comment #9
alexpottAlso in text.schema.yml for example:
Afaics text_processing is a boolean
Comment #10
yched CreditAttribution: yched commented@alexpott: I'm not sure what is the intended process behind the this issue and all the similar subtasks issued from #1653026: [META] Use properly typed values in module configuration.
I assumed (but maybe I'm wrong ?) that this issue was only about fixing the config files that are present in core, not about fixing the APIs and/or UIs so that they actually produce CMI files that comply with those typecasts (which would be a much more involved change).
This being said, I'm indeed not sure when is the right time to update the config schemas accordingly, then...
Comment #11
alexpott@yched but I don't want to have to this task yet again after we've done #2130811: Use config schema in saving and validating configuration form to ensure data is consistent and correct - this change should negate the need to fix APIs and UIs as this will just get everything right :)
Comment #12
yched CreditAttribution: yched commented@alexpott: OK, I'm confused then :-)
What do you think should be done in this issue (if anything) ?
Comment #13
alexpott@yched I think all the "...has no type-casting to string." should be postponed on #2130811: Use config schema in saving and validating configuration form to ensure data is consistent and correct and then this issue should deal with all field config in core and ensure that the schemas are correct too.
Comment #14
yched CreditAttribution: yched commentedOK, makes sense.
Comment #15
vijaycs85The patch on this issue has been updated as part of #2167623: Add test for all default configuration to ensure schema exists and is correct. As this issue doesn't have any test to confirm/validate the schema, making this change and closing this issue as duplicate of #2167623: Add test for all default configuration to ensure schema exists and is correct. The contributors of this issue (in commit message) is copied to #2167623: Add test for all default configuration to ensure schema exists and is correct.