[META] Port crm_core_relationship

Created on 5 May 2019, about 6 years ago
Updated 26 June 2025, 11 days ago

Create a relationship between CRM entities, and in particular support and extend the D7 relationships:

  • „works for“ relationship => individual to organization
  • „is friends with“ relationship => individual to individual
  • „is a partner/vendor/subsidiary/competitor“ of relationship => organization to organization

Note that „is a member of“ is no longer separately necessary as households are subsumed under organizations. Also, a source can have several relations to a certain type of target (i.e. one organization has a parent, a subsidiary and 7 competitor organizations at the same time).

The implementation should be flexible enough to be extendable by others.

Some discussion about this already took place in 2016 in #2699811: [META] Data model discussions .

Two general approaches are possible:

Approach 1: As a separate content entity

This is basically the same behavior as before, which the relation module provided. It has the benefit of making reverse-lookup queries easier to handle with.

However, it introduces significant overhead and cumbersome handling of revisions (i.e. a relationship is set to be no longer active and not tied to a specific revision of the relating entities). An activity could provide the relevant "log" per relationship here to track when a relationship was established and when it was broken.

From a UX perspective it could also be solved more elegantly than in 7 with functionality in the source/target entity context.

In this case the relationship entity would likely use bundles to differentiate types of relationships.

(Adding activities as pointed out above might still be worthwile for a better "log".)

Tasks to complete

Current state available in referenced branch

  • ✅ Create content entity "Relationship"
  • ✅ Create local action on relevant entities
  • ❌ Pre-fill local action on add-relationship screen
  • ❌ Create activities on relationship creation
  • ❌ Make activity creation configurable on relationship creation
  • ❌ Test coverage
  • Optional: Provide ability to switch relation in add-screen on co-equal types
🌱 Plan
Status

Active

Version

3.0

Component

Documentation

Created by

🇨🇭Switzerland grahl Zürich

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024