Hot answers tagged

1

Use hook_ENTITY_TYPE_prepare_form if you want to change a field value before the form is built for an existing node: <?php use Drupal\node\NodeInterface; use Drupal\Core\Form\FormStateInterface; /** * Implements hook_ENTITY_TYPE_prepare_form() for node entities. */ function mymodule_node_prepare_form(NodeInterface $node, $operation, FormStateInterface ...


Only top voted, non community-wiki answers of a minimum length are eligible