Problem/Motivation
To simply the UserContactMappingSettingsForm, we can use #config_target, given that the config entity has a valid schema.
See https://www.drupal.org/node/3373502
Proposed resolution
- Use #config_target logic for the UserContactMappingSettingsForm
Issue fork crm-3568164
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #7
svendecabooterThis MR uses the #config_target functionality.
I also added a constraint to declare the config fully validatable.
This exposed another issue in the tests, in that the
crm.user_contact_mapping.settingswere defined as a config_entity in the schema, where they are just a simple config_object. I have fixed that as well now.There were some errors in
tests/src/Kernel/Form/UserContactMappingSettingsFormTest.phpdue to this change, since this test added a lot of assertions around #default_value states and the use the of config service, which is abstracted away by using #config_target. To be checked if this test still provides any actual value, since config form handling with #config_target has test coverage in Drupal core itself.Comment #8
svendecabootertests/src/Kernel/Form/UserContactMappingSettingsFormTest.phpis still failing, because of unncessary tests.I'm having a hard time identifying which parts of the tests are still needed after this change, and which can be removed...
Comment #9
bluegeek9 commentedComment #10
bluegeek9 commented