Overrides \Drupal\Core\Entity\EntityFormController::prepareEntity().
Prepares the custom block object.
Fills in a few default values, and then invokes hook_custom_block_prepare() on all modules.
Overrides EntityFormController::prepareEntity
protected function prepareEntity() {
$block = $this->entity;
// Set up default values, if required.
$block_type = entity_load('custom_block_type', $block->type->value);
// If this is a new custom block, fill in the default values.
if (isset($block->id->value)) {
$block
->set('log', NULL);
}
// Always use the default revision setting.
$block
->setNewRevision($block_type->revision);
module_invoke_all('custom_block_prepare', $block);
}