Allow to define entity based relationships to allow implicit assignments

Created on 26 May 2025, 8 days ago

Problem/Motivation

As described in 🐛 Creating a new inheritance doesn't get added to existing children Active , when new Field Inheritance relationships are created, it is necessary to modify all the entities that want to make use of those relationships.

That's because the way how he relationships are stored in the database are 1:1 between the parent and the child entity for each relationship.

Given that many times the user end up having many relationships between the same entities, the aim of this iossue is to propose a new way to define those relationships entity based.

Before:

fields:
  relationship_x:
    skip: false
    entity: a
  relationship_y:
   skip: true
    entity: a
  relationship_z:
   skip: false
    entity: a
  .....

After:

entity:
  'entity_type:bundle': a

In this way, any new relationship created that maps to the entity_type: bundle combination is assigned directly to entity a. Hence is not necessary to edit and explicitly assign that relationship.

However, this configuration might be overkill and would not give support for different scenarios where some of the relationships are ignored, or simply not all of them reference to the same entity

In order to give more granularity and avoid possible conflicts, the new storage approach would looks like this to allow to override defaults in case where different entities of the same bundle could be considered as parents:

entity:
  'entity_type:bundle': a
fields:
  relationship_x:
    skip: false
    entity: b
  relationship_y:
    skip: true
    entity: b

Then any reference to the entity_type:bundle combination would be assigned to a, except the relationship_x, which will take into account the entity b. Also relationship_y would be skipped.

Proposed resolution

Implement a more generic and flexible storage system.

Remaining tasks

Finish the definition and implement it.

User interface changes

Widget might require to be updated to support the new logic.

API changes

Storage structure would be affected.

Data model changes

Storage structure would be affected.

📌 Task
Status

Active

Version

3.0

Component

Code

Created by

🇪🇸Spain plopesc Valladolid

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

Comments & Activities

Production build 0.71.5 2024