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 49687e5..6b32600 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 @@ -61,11 +61,10 @@ public static function create(ContainerInterface $container) { * A HTML-formatted string with the administrative page content. */ public function fieldsList() { - $instances = $this->fieldInfo->getInstances(); + $fields = $this->fieldInfo->getFieldMap(); $field_types = field_info_field_types(); $bundles = entity_get_bundles(); $entity_manager = $this->entityManager; - $modules = system_rebuild_module_data(); $header = array( @@ -74,25 +73,23 @@ public function fieldsList() { t('Used in'), ); $rows = array(); - foreach ($instances as $entity_type => $type_bundles) { - foreach ($type_bundles as $bundle => $bundle_instances) { - foreach ($bundle_instances as $field_name => $instance) { - $field = field_info_field($field_name); + foreach($fields as $field_name => $field_info) { + $field = field_info_field($field_name); - // Initialize the row if we encounter the field for the first time. - if (!isset($rows[$field_name])) { - $rows[$field_name]['class'] = $field['locked'] ? array('menu-disabled') : array(''); - $rows[$field_name]['data'][0] = $field['locked'] ? t('@field_name (Locked)', array('@field_name' => $field_name)) : $field_name; - $module_name = $field_types[$field['type']]['module']; - $rows[$field_name]['data'][1] = $field_types[$field['type']]['label'] . ' ' . t('(module: !module)', array('!module' => $modules[$module_name]->info['name'])); - } + $rows[$field_name]['class'] = $field['locked'] ? array('menu-disabled') : array(''); + $rows[$field_name]['data'][0] = $field['locked'] ? t('@field_name (Locked)', array('@field_name' => $field_name)) : $field_name; + $module_name = $field_types[$field['type']]['module']; + $rows[$field_name]['data'][1] = $field_types[$field['type']]['label'] . ' ' . t('(module: !module)', array('!module' => $modules[$module_name]->info['name'])); - // Add the current instance. + // Add all instances for this field. + foreach($field_info['bundles'] as $entity_type => $field_bundles) { + foreach($field_bundles as $bundle) { $admin_path = $entity_manager->getAdminPath($entity_type, $bundle); $rows[$field_name]['data'][2][] = $admin_path ? l($bundles[$entity_type][$bundle]['label'], $admin_path . '/fields') : $bundles[$entity_type][$bundle]['label']; } } } + foreach ($rows as $field_name => $cell) { $rows[$field_name]['data'][2] = implode(', ', $cell['data'][2]); }