Act on a node object about to be shown on the add/edit form.
This hook is invoked from NodeFormController::prepareEntity() after the type-specific hook_prepare() is invoked.
Drupal\node\Node $node: The node that is about to be shown on the add/edit form.
Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.
function hook_node_prepare(Drupal\node\Node $node) {
if (!isset($node->comment)) {
$node->comment = variable_get("comment_{$node->type}", COMMENT_NODE_OPEN);
}
}