Overrides \Drupal\Core\Entity\EntityFormController::save().
Overrides EntityFormController::save
public function save(array $form, array &$form_state) {
$block_type = $this->entity;
$status = $block_type
->save();
$uri = $block_type
->uri();
if ($status == SAVED_UPDATED) {
drupal_set_message(t('Custom block type %label has been updated.', array(
'%label' => $block_type
->label(),
)));
watchdog('custom_block', 'Custom block type %label has been updated.', array(
'%label' => $block_type
->label(),
), WATCHDOG_NOTICE, l(t('Edit'), $uri['path'] . '/edit'));
}
else {
drupal_set_message(t('Custom block type %label has been added.', array(
'%label' => $block_type
->label(),
)));
watchdog('custom_block', 'Custom block type %label has been added.', array(
'%label' => $block_type
->label(),
), WATCHDOG_NOTICE, l(t('Edit'), $uri['path'] . '/edit'));
}
$form_state['redirect'] = 'admin/structure/custom-blocks';
}