Commit 7da31e1e authored by Gábor Hojtsy's avatar Gábor Hojtsy

Issue #2895857 by Wim Leers, chr.fritsch: Remove media_entity_operation_alter() as planned earlier

parent 249e5252
......@@ -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().
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment