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

Command icon 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

svendecabooter created an issue. See original summary.

bluegeek9 made their first commit to this issue’s fork.

bluegeek9 changed the visibility of the branch 1.0.x to hidden.

svendecabooter’s picture

Status: Active » Needs review

This 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.settings were 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.php due 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.

svendecabooter’s picture

Status: Needs review » Needs work

tests/src/Kernel/Form/UserContactMappingSettingsFormTest.php is 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...

bluegeek9’s picture

Status: Needs work » Needs review
bluegeek9’s picture

Status: Needs review » Fixed
//www.flaticon.com/free-icons/thank-you Thank you for your contribution! Your continued support makes this project sustainable.
There are multiple ways to show appreciation for the work contributed to this project including:
  • Triage issues and adding more context to existing issues.
  • Flagging CRM as a favorite on the project page to help others discover it and show your support.
  • Review the Developer Docs for accuracy and clarity.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.