From 7da31e1eae097cb025e80b0f35fd20d4db19324d Mon Sep 17 00:00:00 2001 From: Gabor Hojtsy Date: Thu, 20 Jul 2017 15:21:28 +0200 Subject: [PATCH] Issue #2895857 by Wim Leers, chr.fritsch: Remove media_entity_operation_alter() as planned earlier --- core/modules/media/media.module | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/core/modules/media/media.module b/core/modules/media/media.module index eeb2ac168a39..dc2d898e3c8e 100644 --- a/core/modules/media/media.module +++ b/core/modules/media/media.module @@ -47,24 +47,6 @@ function media_theme() { ]; } -/** - * Implements hook_entity_operation_alter(). - * - * Fix broken operations array in field UI for entities with restricted access. - * - * @todo This hook can be removed when issue #2836384 is done. - * @see https://www.drupal.org/node/2836384 - */ -function media_entity_operation_alter(array &$operations, EntityInterface $entity) { - if ($entity instanceof FieldConfigInterface && $entity->getTargetEntityTypeId() === 'media') { - /** @var \Drupal\media\MediaTypeInterface $media_type */ - $media_type = \Drupal::entityTypeManager()->getStorage('media_type')->load($entity->getTargetBundle()); - if ($entity->id() === 'media.' . $media_type->id() . '.' . $media_type->getSource()->getConfiguration()['source_field']) { - unset($operations['delete']); - } - } -} - /** * Implements hook_entity_access(). */