diff --git a/core/modules/filter/lib/Drupal/filter/FilterFormatAccessController.php b/core/modules/filter/lib/Drupal/filter/FilterFormatAccessController.php index 0d49189..a1edbd9 100644 --- a/core/modules/filter/lib/Drupal/filter/FilterFormatAccessController.php +++ b/core/modules/filter/lib/Drupal/filter/FilterFormatAccessController.php @@ -22,9 +22,14 @@ class FilterFormatAccessController extends EntityAccessController { protected function checkAccess(EntityInterface $entity, $operation, $langcode, AccountInterface $account) { // Handle special cases up front. All users have access to the fallback // format. - if ($entity->isFallbackFormat()) { + if ($operation == 'view' && $entity->isFallbackFormat()) { return TRUE; } + // We do not allow filter formats to be deleted through the UI, because that + // would render any content that uses them unusable. + if ($operation == 'delete') { + return FALSE; + } if ($operation != 'view' && $account->hasPermission('administer filters')) { return TRUE; diff --git a/core/modules/filter/lib/Drupal/filter/FilterFormatListController.php b/core/modules/filter/lib/Drupal/filter/FilterFormatListController.php index 3e1debf..85a0a9f 100644 --- a/core/modules/filter/lib/Drupal/filter/FilterFormatListController.php +++ b/core/modules/filter/lib/Drupal/filter/FilterFormatListController.php @@ -134,10 +134,6 @@ public function getOperations(EntityInterface $entity) { if ($entity->isFallbackFormat()) { unset($operations['disable']); } - - // Formats can never be deleted. - unset($operations['delete']); - return $operations; } /**