Problem/Motivation

In the CRM project, each crm_relationship entity connects two contacts — a source and a target.
Currently, there is no way to limit how many relationships of a given type a contact may have.
In real-world use cases, many relationship types have natural limits. For example:

  • A child usually has two parents.
  • An employee has one primary employer.
  • A student may have one advisor, but an advisor can have many students.

Without per-type relationship limits, data entry can produce logically invalid relationships (e.g., a child with five parents).
Site builders need a configurable way to restrict the number of relationships a contact can have per relationship type and per side (source or target).

Steps to reproduce

  1. Create a relationship type (e.g., Parent → Child).
  2. Add multiple Parent–Child relationships with the same child contact.
  3. Observe that there are no limits enforced — any number of parent relationships can be created.

Issue fork crm-3554445

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

bluegeek9 created an issue. See original summary.

bluegeek9’s picture

Title: Add configurable relationship cardinality limits (per side, optional, active-only) to CRM Relationship Type » Add configurable relationship limits (per side, optional, active-only) to CRM Relationship Type
bluegeek9’s picture

Title: Add configurable relationship limits (per side, optional, active-only) to CRM Relationship Type » Relationship: Add configurable limits (per side, optional, active-only)

  • bluegeek9 committed ae5940e2 on 1.0.x
    feat: #3554445 Relationship: Add configurable limits (per side, optional...
bluegeek9’s picture

Status: Active » 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.