Skip to content

Commit

Permalink
Install file for configs
Browse files Browse the repository at this point in the history
  • Loading branch information
kedarkhaire committed Aug 18, 2023
1 parent 418f61a commit 4d0e3b4
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
16 changes: 16 additions & 0 deletions apigee_edge.install
Original file line number Diff line number Diff line change
Expand Up @@ -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().
Expand Down Expand Up @@ -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);
}
17 changes: 17 additions & 0 deletions modules/apigee_edge_teams/apigee_edge_teams.install
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}


0 comments on commit 4d0e3b4

Please sign in to comment.