From 4d0e3b469d2c3ce9b217d1be121939fd9175a6f4 Mon Sep 17 00:00:00 2001 From: Kedar Khaire Date: Fri, 11 Aug 2023 17:49:04 +0530 Subject: [PATCH] Install file for configs --- apigee_edge.install | 16 ++++++++++++++++ .../apigee_edge_teams/apigee_edge_teams.install | 17 +++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/apigee_edge.install b/apigee_edge.install index e0837b597..5b90828c2 100644 --- a/apigee_edge.install +++ b/apigee_edge.install @@ -28,6 +28,7 @@ use Drupal\Core\Field\BaseFieldDefinition; use Drupal\Core\Installer\InstallerKernel; use Drupal\Core\Url; use Drupal\user\RoleInterface; +use Drupal\Core\Config\FileStorage; /** * Implements hook_requirements(). @@ -373,3 +374,18 @@ function apigee_edge_update_9001() { $definition_update_manager->updateFieldableEntityType($entity_type, $field_storage_definitions); } + +/** + * Install Configs for Core Entity View Display for Default Team App + */ +function apigee_edge_update_9002() { + // Update existing config. + /** @var \Drupal\Core\Config\StorageInterface $config_storage */ + $config_storage = \Drupal::service('config.storage'); + $module_path = \Drupal::service('extension.list.module')->getPath('apigee_edge'); + $source = new FileStorage("$module_path/config/install"); + $new_edge_settings = $source->read('core.entity_view_display.developer_app.developer_app.default'); + $edge_settings = $config_storage->read('core.entity_view_display.developer_app.developer_app.default'); + $edge_settings['content'] = $new_edge_settings['content']; + $config_storage->write('core.entity_view_display.developer_app.developer_app.default', $edge_settings); +} diff --git a/modules/apigee_edge_teams/apigee_edge_teams.install b/modules/apigee_edge_teams/apigee_edge_teams.install index bd629d1f6..3047ded83 100644 --- a/modules/apigee_edge_teams/apigee_edge_teams.install +++ b/modules/apigee_edge_teams/apigee_edge_teams.install @@ -200,3 +200,20 @@ function apigee_edge_teams_update_9001() { $definition_update_manager->updateFieldableEntityType($entity_type, $field_storage_definitions); } + +/** + * Install Configs for Core Entity View Display for Default Team App + */ +function apigee_edge_teams_update_9002() { + // Update existing config. + /** @var \Drupal\Core\Config\StorageInterface $config_storage */ + $config_storage = \Drupal::service('config.storage'); + $module_path = \Drupal::service('extension.list.module')->getPath('apigee_edge_teams'); + $source = new FileStorage("$module_path/config/install"); + $new_team_settings = $source->read('core.entity_view_display.team_app.team_app.default'); + $team_settings = $config_storage->read('core.entity_view_display.team_app.team_app.default'); + $team_settings['content'] = $new_team_settings['content']; + $config_storage->write('core.entity_view_display.team_app.team_app.default', $team_settings); +} + +