Use hook_form_alter or hook_form_FORM_ID_alter
Add a custom validation that runs after all validation has passed
$form['actions']['submit']['#submit'][] = 'mymodule_update_referenced_nodes';
Then in that function
function mymodule_update_referenced_nodes(&$form, \Drupal\Core\Form\FormStateInterface $form_state){
$field_other = $form_state->getValue('field_other')[0]['value'];
$references = $node->get('field_referenced')->referencedEntities();
foreach ($references as $referenced_node) {
$referenced_node->field_other->value = $field_other;
$referenced_node->save();
}
}
hook_entity_update()
. Could you provide a tip what condition can help to stop infinite recursion? – Dimetry Aug 23 '20 at 8:20