Commit ebcfb3a0 authored by George's avatar George
Browse files

Issue #3310100 - Support more config entity types.

parent 457b4fa7
Loading
Loading
Loading
Loading
+10 −6
Original line number Diff line number Diff line
@@ -37,9 +37,7 @@ function config_view_views_data() {
  $config_entities = ConfigViewHelper::getConfigEntities();

  if (!empty($config_entities)) {

    foreach ($config_entities as $id => $conf) {

      if ($conf !== 0) {
        try {
          // Fill in base data.
@@ -50,17 +48,23 @@ function config_view_views_data() {
          $table['table']['entity type'] = $id;
          $fields = ConfigViewHelper::getMapping($id);

          if (empty($fields['id'])) {
          // Locate the config entity type's ID.
          $entityType = \Drupal::entityTypeManager()
            ->getStorage($id)
            ->getEntityType();
          $id_key = $entityType->getKey('id');

          if (empty($fields[$id_key])) {
            continue;
          }

          if (empty($fields['id']['label'])) {
          if (empty($fields[$id_key]['label'])) {
            continue;
          }

          $table['table']['base'] = [
            'field' => strtolower($fields['id']['label']),
            'index' => strtolower($fields['id']['label']),
            'field' => strtolower($fields[$id_key]['label']),
            'index' => strtolower($fields[$id_key]['label']),
            'title' => $name,
            'help' => t('Use the ConfigEntity @name to view the data.', ['@name' => $name]),
            'query_id' => 'config_view_query',