drupal-eca-recipe / eca_lib_0018
Keeps a user field and a profile field in sync in both directions, writing to the other entity only when the values actually differ so the updates cannot loop forever.
Package info
gitlab.lakedrops.com/drupal/recipes/eca_lib_0018
Type:drupal-recipe
pkg:composer/drupal-eca-recipe/eca_lib_0018
Requires
- drupal/eca: *
- drupal/modeler_api: *
- drupal/profile: *
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
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-recipe/eca_lib_0018
# Apply recipe with Drush (requires version 13 or later):
drush recipe ../recipes/eca_lib_0018
# Apply recipe without Drush:
cd web && php core/scripts/drupal recipe ../recipes/eca_lib_0018
# Rebuilding caches is optional, sometimes required:
drush cr