function node_node_type_presave
Implements hook_ENTITY_TYPE_presave().
File
-
core/
modules/ node/ node.module, line 1329
Code
function node_node_type_presave(NodeTypeInterface $node_type) {
// Content types' `help` and `description` fields must be stored as NULL
// at the config level if they are empty.
// @see node_post_update_set_node_type_description_and_help_to_null()
if (trim($node_type->getDescription()) === '') {
$node_type->set('description', NULL);
}
if (trim($node_type->getHelp()) === '') {
$node_type->set('help', NULL);
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.