Overrides Drupal\Core\Entity\DatabaseStorageController::postSave().
Overrides DatabaseStorageController::postSave
protected function postSave(EntityInterface $entity, $update) {
if (!$update) {
field_attach_create_bundle('taxonomy_term', $entity->machine_name);
}
elseif ($entity->original->machine_name != $entity->machine_name) {
field_attach_rename_bundle('taxonomy_term', $entity->original->machine_name, $entity->machine_name);
}
}