Keep 2 fields in sync¶
Version
You can apply this model as a recipe (Drupal 10.3 or later) to your own Drupal site:
1 2 3 4 5 6 7 8 9 10 11 |
|
Purpose¶
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
Dependencies¶
- config
- field.field.profile.contact_detail.field_real_name
- field.field.user.user.field_real_name
- field.storage.profile.field_real_name
- field.storage.user.field_real_name
- profile.type.contact_detail
- module
- eca_base
- eca_content
- profile
- user