diff -u b/core/modules/field/lib/Drupal/field/Entity/FieldInstanceConfig.php b/core/modules/field/lib/Drupal/field/Entity/FieldInstanceConfig.php --- b/core/modules/field/lib/Drupal/field/Entity/FieldInstanceConfig.php +++ b/core/modules/field/lib/Drupal/field/Entity/FieldInstanceConfig.php @@ -23,7 +23,7 @@ * id = "field_instance_config", * label = @Translation("Field instance"), * controllers = { - * "list_builder" = "\Drupal\Core\Config\Entity\ConfigEntityListBuilder", + * "list_builder" = "\Drupal\field_ui\FieldInstanceListBuilder", * "storage" = "Drupal\field\FieldInstanceConfigStorageController" * }, * config_prefix = "instance", diff -u b/core/modules/field_ui/lib/Drupal/field_ui/FieldOverview.php b/core/modules/field_ui/lib/Drupal/field_ui/FieldOverview.php --- b/core/modules/field_ui/lib/Drupal/field_ui/FieldOverview.php +++ b/core/modules/field_ui/lib/Drupal/field_ui/FieldOverview.php @@ -135,25 +135,6 @@ ), ); - $links = array(); - $links['edit'] = array( - 'title' => $this->t('Edit'), - 'route_name' => 'field_ui.instance_edit_' . $this->entity_type, - 'route_parameters' => $route_parameters, - 'attributes' => array('title' => $this->t('Edit instance settings.')), - ); - $links['field-settings'] = array( - 'title' => $this->t('Field settings'), - 'route_name' => 'field_ui.field_edit_' . $this->entity_type, - 'route_parameters' => $route_parameters, - 'attributes' => array('title' => $this->t('Edit field settings.')), - ); - $links['delete'] = array( - 'title' => $this->t('Delete'), - 'route_name' => 'field_ui.delete_' . $this->entity_type, - 'route_parameters' => $route_parameters, - 'attributes' => array('title' => $this->t('Delete instance.')), - ); $table[$name]['operations']['data'] = array( '#type' => 'operations', '#links' => $this->entityManager->getListBuilder('field_instance_config')->getOperations($instance), only in patch2: unchanged: --- /dev/null +++ b/core/modules/field_ui/lib/Drupal/field_ui/FieldInstanceListBuilder.php @@ -0,0 +1,90 @@ +getStorageController($entity_type->id())); + $this->entityManager = $entity_manager; + + } + + /** + * {@inheritdoc} + */ + public static function createInstance(ContainerInterface $container, EntityTypeInterface $entity_type) { + return new static($entity_type, $container->get('entity.manager')); + } + + /** + * {@inheritdoc} + */ + public function render() { + throw new \Exception('This class is only used for operations and not for building lists.'); + } + + /** + * {@inheritdoc} + */ + public function getDefaultOperations(EntityInterface $entity) { + /** @var \Drupal\field\FieldInstanceConfigInterface $entity */ + $operations = parent::getDefaultOperations($entity); + + $target_entity_type_bundle_entity_type_id = $this->entityManager->getDefinition($entity->getTargetEntityTypeId())->getBundleEntityType(); + $route_parameters = array( + $target_entity_type_bundle_entity_type_id => $entity->targetBundle(), + 'field_instance_config' => $entity->id(), + ); + $operations['edit'] = array( + 'title' => $this->t('Edit'), + 'route_name' => 'field_ui.instance_edit_' . $entity->getTargetEntityTypeId(), + 'route_parameters' => $route_parameters, + 'attributes' => array('title' => $this->t('Edit instance settings.')), + ); + $operations['field-settings'] = array( + 'title' => $this->t('Field settings'), + 'route_name' => 'field_ui.field_edit_' . $entity->getTargetEntityTypeId(), + 'route_parameters' => $route_parameters, + 'attributes' => array('title' => $this->t('Edit field settings.')), + ); + $operations['delete'] = array( + 'title' => $this->t('Delete'), + 'route_name' => 'field_ui.delete_' . $entity->getTargetEntityTypeId(), + 'route_parameters' => $route_parameters, + 'attributes' => array('title' => $this->t('Delete instance.')), + ); + + return $operations; + } + +}