diff --git a/core/modules/field_ui/lib/Drupal/field_ui/FieldOverview.php b/core/modules/field_ui/lib/Drupal/field_ui/FieldOverview.php index 8e7e770..96ee221 100644 --- a/core/modules/field_ui/lib/Drupal/field_ui/FieldOverview.php +++ b/core/modules/field_ui/lib/Drupal/field_ui/FieldOverview.php @@ -10,12 +10,44 @@ use Drupal\field_ui\OverviewBase; use Symfony\Component\DependencyInjection\ContainerInterface; use Drupal\field\Plugin\Core\Entity\Field; +use Drupal\Core\Extension\ModuleHandlerInterface; +use Drupal\Core\Entity\EntityManager; /** * Field UI field overview form. */ class FieldOverview extends OverviewBase { + + /** + * The module handler service. + * + * @var \Drupal\Core\Extension\ModuleHandlerInterface + */ + protected $moduleHandler; + + + /** + * Constructs a new field overview. + * + * @param \Drupal\Core\Entity\EntityManager $entity_manager + * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler + */ + public function __construct(EntityManager $entity_manager, ModuleHandlerInterface $module_handler) { + $this->entityManager = $entity_manager; + $this->moduleHandler = $module_handler; + } + + /** + * {@inheritdoc} + */ + public static function create(ContainerInterface $container) { + return new static( + $container->get('plugin.manager.entity'), + $container->get('module_handler') + ); + } + /** * {@inheritdoc} */ @@ -110,6 +142,8 @@ public function buildForm(array $form, array &$form_state, $entity_type = NULL, 'href' => "$admin_field_path/delete", 'attributes' => array('title' => t('Delete instance.')), ); + // Allow altering the operations on this entity listing. + $this->moduleHandler->alter('entity_operation', $links, $instance); $table[$name]['operations']['data'] = array( '#type' => 'operations', '#links' => $links,