Problem/Motivation

When enabling the CRM Group relation plugin for contacts (for example group_crm_contact:person), exported config for the resulting relationship type contains an invalid dependency:

dependencies:
  config:
    - crm_contact.type.person

But the actual config entity name is:

crm.crm_contact_type.person

This causes config import failures such as:

Configuration group.relationship_type.account-group_crm_contact-person
depends on the crm_contact.type.person configuration that will not exist after import.

The problem appears to come from Drupal\crm\Plugin\Group\Relation\GroupContact::calculateDependencies(), which currently appends:

$dependencies['config'][] = 'crm_contact.type.' . $this->getRelationType()->getEntityBundle();

But the CRM contact type config prefix is crm.crm_contact_type.

Steps to reproduce

  1. Install the CRM module.
  2. Enable the Group relation plugin for a CRM person contact on a group type.
  3. Export config.
  4. Attempt to import that config again.

Proposed resolution

Change the dependency generation to use the correct config prefix:

$dependencies['config'][] = 'crm.crm_contact_type.' . $this->getRelationType()->getEntityBundle();

Remaining tasks

  1. Update GroupContact::calculateDependencies().
  2. Verify exported relationship type config uses crm.crm_contact_type.person.
  3. Confirm config export/import succeeds after the change.

User interface changes

None.

API changes

None.

Data model changes

None.

Issue summary generated with AI assistance.

Issue fork crm-3601135

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

freelock created an issue. See original summary.

freelock’s picture

Status: Active » Needs review

Needs review.

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

  • bluegeek9 committed 3688cbf1 on 1.0.x authored by freelock
    fix: #3601135 GroupContact::calculateDependencies() generates invalid...
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.