drupal-eca-recipe / eca_lib_0018
Keep 2 fields in sync
3.1.0
2025-08-01 15:01 UTC
Requires
- drupal/core: >=11.2
- drupal/eca: ^3
- drupal/profile: *
README
ID: eca_lib_0018
This model demonstrates how a text field in a user entity can be kept in sync with a similar field in an associated profile entity. This works in both directions. Regardless which of the entities gets updated, the other one will be updated automatically as well.
Without paying attention, this could lead into an infinite loop. Therefore, the related entity only gets updated if the field values are not the same already.
The creation of that model has been recorded: Watch the video
Installation
## Import recipe
composer require drupal/eca_lib_0018
# Apply recipe with Drush (requires version 13 or later):
drush recipe ../recipes/{{ rawid }}
# Apply recipe without Drush:
cd web && php core/scripts/drupal recipe ../recipes/eca_lib_0018
# Rebuilding caches is optional, sometimes required:
drush cr