Identify when an inline entity reference form changes

Created on 20 March 2025, 17 days ago

Problem/Motivation

Presently when an address is changed, value revisions does not see that as a change because the entity reference ID does not change.

Steps to reproduce

Proposed resolution

Ideally we find some way to hash referenced entity values so we know when there is a change corresponding to saving the inline-edited entity reference and the entity for which value revisions is operating.

Alternatively or in combination we use an as-yet-to-be-determined mechanism to allow manually marking an unchanged value to be updated to have the provenance of the current revision, but detect changes and automatically do that toggle.

Remaining tasks

User interface changes

API changes

Data model changes

โœจ Feature request
Status

Active

Version

1.0

Component

Code

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States mlncn Minneapolis, MN, USA

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

Comments & Activities

  • Issue created by @mlncn
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States mlncn Minneapolis, MN, USA

    Actually the best solution would be to use https://www.drupal.org/project/entity_reference_revisions โ†’ and then we would be saving the revision ID instead of the entity ID.

    So long as that is smart enough not to change the revision ID if nothing changes (doubtful?)

    And provided it works with Address module.

    • mlncn โ†’ committed f94e0faf on 1.0.x
      Issue #3514204 by mlncn: Added special handling for address entities; i...
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States mlncn Minneapolis, MN, USA

    Above commit appears to work perfectly (for the narrow and i think our only current use case of addresses); i just had thought i'd made the revision an official source when i had not. If we have any other inline entity references it should be pretty easy to expand that approach.

    Well, with one more caveatโ€” we are checking only one field on the address entity, field_address. (That one field happens to have like 14 parts, of which we currently check about half for the value hash, but it could be made all easily.) The present client actually adds another field, for the type of address (mailing, physical etc). I am willfully ignoring that in the value hash as not important enough to affect which revision the address is attributed to. But most inline entities will probably be made up of several relevant fields which would entail a different, and certainly more annoying, strategy for calculating value hashes.

Production build 0.71.5 2024