diff --git a/core/modules/field_ui/lib/Drupal/field_ui/Controller/FieldUIController.php b/core/modules/field_ui/lib/Drupal/field_ui/Controller/FieldUIController.php index 8465e7a..81b1518 100644 --- a/core/modules/field_ui/lib/Drupal/field_ui/Controller/FieldUIController.php +++ b/core/modules/field_ui/lib/Drupal/field_ui/Controller/FieldUIController.php @@ -8,6 +8,8 @@ namespace Drupal\field_ui\Controller; use Drupal\Core\ControllerInterface; +use Drupal\Core\Entity\EntityManager; +use Drupal\field\FieldInfo; use Symfony\Component\DependencyInjection\ContainerInterface; /** @@ -16,10 +18,38 @@ class FieldUIController implements ControllerInterface { /** + * The entity manager to use to load unchanged entities. + * + * @var \Drupal\Core\Entity\EntityManager + */ + protected $entityManager; + + /** + * Provides field and instance definitions. + * + * @var \Drupal\field\FieldInfo + */ + protected $fieldInfo; + + /** + * Constructs a FieldTranslationSynchronizer object. + * + * @param \Drupal\Core\Entity\EntityManager $entityManager + * The entity manager. + */ + public function __construct(EntityManager $entityManager, FieldInfo $fieldInfo) { + $this->entityManager = $entityManager; + $this->fieldInfo = $fieldInfo; + } + + /** * {@inheritdoc} */ public static function create(ContainerInterface $container) { - return new static(); + return new static( + $container->get('plugin.manager.entity'), + $container->get('field.info') + ); } /** @@ -29,10 +59,10 @@ public static function create(ContainerInterface $container) { * A HTML-formatted string with the administrative page content. */ public function fieldsList() { - $instances = field_info_instances(); + $instances = $this->fieldInfo->getInstances(); $field_types = field_info_field_types(); $bundles = entity_get_bundles(); - $entity_manager = \Drupal::entityManager(); + $entity_manager = $this->entityManager; $modules = system_rebuild_module_data(); @@ -75,4 +105,4 @@ public function fieldsList() { return $output; } -} \ No newline at end of file +}