Support for custom base fields

Created on 1 February 2023, almost 2 years ago
Updated 20 August 2023, over 1 year ago

Problem/Motivation

I have two custom entities with base fields that refer to each other.

Steps to reproduce

1. Add CER item by /admin/config/content/cer/add
2. No reference base fields on the First field, Second field fields.

✨ Feature request
Status

Needs review

Version

5.0

Component

Code

Created by

πŸ‡ΊπŸ‡¦Ukraine goodboy Kharkiv, Ukraine

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

Comments & Activities

  • Issue created by @goodboy
  • First commit to issue fork.
  • Status changed to Needs review over 1 year ago
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 10.0.7 + Environment: PHP 8.1 & MySQL 8
    last update over 1 year ago
    2 pass
  • πŸ‡ΊπŸ‡ΈUnited States mrweiner

    For some reason I'm having trouble pushing to the issue fork, but here's a patch to make base fields work. The module has a preg_match in it's logic to only allow "field_" fields. The patch just removes this and then adds a nullable check for target_bundles, since it may not be present on a base field at all.

  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 10.0.7 + Environment: PHP 8.1 & MySQL 8
    last update over 1 year ago
    2 pass
  • @mrweiner opened merge request.
  • πŸ‡ΊπŸ‡ΈUnited States mrweiner

    Sorry for the mess of branches and patches. The MR should be the correct updates and the correct fork/branch. The MR also includes asort() on the options, which isn't present in the patch. Not sure whether this needs tests or not. Maybe a module setting for whether to include base fields?

  • πŸ‡ΊπŸ‡ΈUnited States mrweiner

    This actually may duplicate the discussion in https://www.drupal.org/project/cer/issues/2998138 ✨ Could support Remove field name prefix module? Needs work

  • πŸ‡ΊπŸ‡¦Ukraine goodboy Kharkiv, Ukraine

    Thanks, @mrweiner
    I've created a light custom module which used the CER Resolver. I don't use entities and store an entity referenced map to YML-file.
    As I understand it, it makes no sense to publish my module as a separate ones.

Production build 0.71.5 2024