- Issue created by @mogtofu33
- 🇫🇷France Grimreaper France 🇫🇷
mogtofu33 → credited Grimreaper → .
- 🇫🇷France mogtofu33
Settings flatten removing extractor id.
Need to check schema errors when using UI Icon field or Link with Icon and default value set.
Related to this private mr. - Assigned to Grimreaper
- Merge request !9Issue #3466324 by mogtofu33, grimreaper: [1.0.0-alpha3] Config Schema: flatten structure → (Merged) created by Grimreaper
- Issue was unassigned.
- Status changed to Needs review
4 months ago 4:36pm 19 August 2024 - 🇫🇷France Grimreaper France 🇫🇷
Config schema fixed.
I have not tested with all the submodules of modules/ui_icons_example/modules/
Should an automatic schema be provided if an icon pack does not have its schema type declared?
- 🇫🇷France Grimreaper France 🇫🇷
Default schema provided. No hook config schema default alter needed.
- Assigned to Grimreaper
- Status changed to Needs work
4 months ago 7:49am 20 August 2024 - Issue was unassigned.
- Status changed to Needs review
4 months ago 8:01am 20 August 2024 - 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
If you would like to add config schema validation, and test that, ahead of potential core inclusion, then add this to your functional tests:
/** * {@inheritdoc} */ protected function prepareSettings(): void { parent::prepareSettings(); $directory = DRUPAL_ROOT . '/' . $this->siteDirectory; // @todo Why does phpstan not know of the Yaml class. // @phpstan-ignore-next-line $services = Yaml::decode(file_get_contents($directory . '/services.yml')); // Opt in to strict config schema checking, even though this is a contrib // module. $services['services']['testing.config_schema_checker']['arguments'][2] = TRUE; // @todo Why does phpstan not know of the Yaml class. // @phpstan-ignore-next-line file_put_contents($directory . '/services.yml', Yaml::encode($services)); }
and for kernel tests, copy this trait into this codebase and
use
it in those test classes: https://git.drupalcode.org/project/experience_builder/-/blob/0.x/tests/s...… but perhaps that is out of scope?
- 🇫🇷France mogtofu33
Currently when saving a FieldWidget default value or FieldFormatter settings for an icon, we can not maintain types of extractor settings, everything is 'string'.
So we still have config errors with types.Should we find a way to store with types, which seems complicated as types in the definition are only used to be converted to proper Drupal API field.
Could we set all types as 'string', but then we lost the typing feature of schemas...?
- Status changed to Needs work
4 months ago 10:50am 20 August 2024 - 🇫🇷France mogtofu33
My bad on previous comment, working well with types, had to re-save.
Just need alter schema for the field_link to allow our icon and icon_display storage under field.value.link.options.
- Assigned to Grimreaper
- 🇫🇷France Grimreaper France 🇫🇷
Comment 13 discussed live, config just needed to be re-saved.
I will handle field.value.link new keys.
Then give you back the hand for the automated tests and to have config validatable.
- Issue was unassigned.
- 🇫🇷France Grimreaper France 🇫🇷
field.value.link handled. Also link_attributes is not handling its own new config keys...
And added config validation like in code review of @Wim Leers
Now need automated tests.
- Status changed to Fixed
4 months ago 4:17pm 20 August 2024 -
mogtofu33 →
committed 5de704cd on 1.0.x authored by
grimreaper →
Issue #3466324 by mogtofu33, grimreaper: [1.0.0-alpha3] Config Schema:...
-
mogtofu33 →
committed 5de704cd on 1.0.x authored by
grimreaper →
- Status changed to Fixed
4 months ago 11:56am 29 August 2024