Skip to content
This repository has been archived by the owner on Jul 8, 2022. It is now read-only.

Commit

Permalink
[RGTC-1875] Replace drupal_get_path
Browse files Browse the repository at this point in the history
  • Loading branch information
shuklina committed Jan 5, 2022
1 parent c87a76c commit 397ff05
Show file tree
Hide file tree
Showing 13 changed files with 61 additions and 61 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function openy_gc_auth_custom_update_8001() {
* Set proper permissions to access the new rest endpoint.
*/
function openy_gc_auth_custom_update_8002() {
$config_dir = drupal_get_path('module', 'openy_gc_auth_custom');
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_gc_auth_custom');
$config_dir .= '/config/install/';
// Import new configuration.
$config_importer = \Drupal::service('openy_upgrade_tool.importer');
Expand Down Expand Up @@ -82,7 +82,7 @@ function _openy_gc_auth_custom_update_user_permissions() {
* Use 'administer gated content configuration' permission in virtual_y_users.
*/
function openy_gc_auth_custom_update_8003() {
$config_dir = drupal_get_path('module', 'openy_gc_auth_custom');
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_gc_auth_custom');
$config_dir .= '/config/install/';
// Import new configuration.
$config_importer = \Drupal::service('openy_upgrade_tool.importer');
Expand All @@ -96,7 +96,7 @@ function openy_gc_auth_custom_update_8003() {
* Use user entity instead of custom im migration.
*/
function openy_gc_auth_custom_update_8004() {
$config_dir = drupal_get_path('module', 'openy_gc_auth_custom');
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_gc_auth_custom');
$config_dir .= '/config/install/';
// Import new configuration.
$config_importer = \Drupal::service('openy_upgrade_tool.importer');
Expand All @@ -116,7 +116,7 @@ function openy_gc_auth_custom_update_8004() {
* Update migration configs according to migrate_source_csv:v3.
*/
function openy_gc_auth_custom_update_8006() {
$config_dir = drupal_get_path('module', 'openy_gc_auth_custom');
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_gc_auth_custom');
$config_dir .= '/config/install/';
// Import new configuration.
$config_importer = \Drupal::service('openy_upgrade_tool.importer');
Expand Down Expand Up @@ -152,7 +152,7 @@ function openy_gc_auth_custom_update_8008(&$sandbox) {
* Add SkipRowIfEmailExcluded migrate process plugin to csv migration.
*/
function openy_gc_auth_custom_update_8009(&$sandbox) {
$config_dir = drupal_get_path('module', 'openy_gc_auth_custom');
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_gc_auth_custom');
$config_dir .= '/config/install/';
// Update multiple configurations.
$configs = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* Update configuration.
*/
function openy_gc_auth_daxko_sso_update_8001(&$sandbox) {
$config_dir = drupal_get_path('module', 'openy_gc_auth_daxko_sso') . '/config/install/';
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_gc_auth_daxko_sso') . '/config/install/';
// Update multiple configurations.
$configs = [
'openy_gc_auth.provider.daxko_sso' => [
Expand All @@ -31,7 +31,7 @@ function openy_gc_auth_daxko_sso_update_8001(&$sandbox) {
* Add value for login_mode variable.
*/
function openy_gc_auth_daxko_sso_update_8002(&$sandbox) {
$config_dir = drupal_get_path('module', 'openy_gc_auth_daxko_sso') . '/config/install/';
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_gc_auth_daxko_sso') . '/config/install/';
// Update multiple configurations.
$configs = [
'openy_gc_auth.provider.daxko_sso' => [
Expand All @@ -55,7 +55,7 @@ function openy_gc_auth_daxko_sso_update_8003(&$sandbox) {
$config_factory = \Drupal::configFactory();
$config = $config_factory->get('openy_gc_auth.provider.daxko_sso')->getRawData();
if (empty($config)) {
$config_dir = drupal_get_path('module', 'openy_gc_auth_daxko_sso');
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_gc_auth_daxko_sso');
$config_dir .= '/config/install/';
// Import new configuration.
$config_importer = \Drupal::service('openy_upgrade_tool.importer');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* Update configuration.
*/
function openy_gc_auth_personify_update_8001(&$sandbox) {
$config_dir = drupal_get_path('module', 'openy_gc_auth_personify') . '/config/install/';
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_gc_auth_personify') . '/config/install/';
// Update multiple configurations.
$configs = [
'openy_gc_auth.provider.personify' => [
Expand All @@ -30,7 +30,7 @@ function openy_gc_auth_personify_update_8001(&$sandbox) {
* Update configuration.
*/
function openy_gc_auth_personify_update_8002(&$sandbox) {
$config_dir = drupal_get_path('module', 'openy_gc_auth_personify') . '/config/install/';
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_gc_auth_personify') . '/config/install/';
// Update multiple configurations.
$configs = [
'openy_gc_auth.provider.personify' => [
Expand Down
20 changes: 10 additions & 10 deletions modules/openy_gc_log/openy_gc_log.install
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function _openy_gc_log_check_files_route() {
}

if ($moduleHandler->moduleExists('file') && !in_array('view.files.page_1', $routes)) {
$config_path = drupal_get_path('module', 'file') . '/config/optional';
$config_path = \Drupal::service('extension.list.module')->getPath('file') . '/config/optional';
$config_source = new FileStorage($config_path);
\Drupal::service('config.installer')->installOptionalConfig($config_source);
}
Expand All @@ -44,7 +44,7 @@ function _openy_gc_log_check_files_route() {
* Update logs view.
*/
function openy_gc_log_update_8002() {
$config_dir = drupal_get_path('module', 'openy_gc_log');
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_gc_log');
$config_dir .= '/config/install/';
$config_importer = \Drupal::service('openy_upgrade_tool.importer');
$config_importer->setDirectory($config_dir);
Expand All @@ -69,7 +69,7 @@ function openy_gc_log_update_8003() {
$fields[$field_name]
);
// Update the logs view.
$config_dir = drupal_get_path('module', 'openy_gc_log');
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_gc_log');
$config_dir .= '/config/install/';
$config_importer = \Drupal::service('openy_upgrade_tool.importer');
$config_importer->setDirectory($config_dir);
Expand All @@ -83,7 +83,7 @@ function openy_gc_log_update_8003() {
*/
function openy_gc_log_update_8004() {
// Update the logs view.
$config_dir = drupal_get_path('module', 'openy_gc_log');
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_gc_log');
$config_dir .= '/config/install/';
$config_importer = \Drupal::service('openy_upgrade_tool.importer');
$config_importer->setDirectory($config_dir);
Expand All @@ -97,7 +97,7 @@ function openy_gc_log_update_8004() {
*/
function openy_gc_log_update_8005() {
// Update the logs view.
$config_dir = drupal_get_path('module', 'openy_gc_log');
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_gc_log');
$config_dir .= '/config/install/';
$config_importer = \Drupal::service('openy_upgrade_tool.importer');
$config_importer->setDirectory($config_dir);
Expand All @@ -110,7 +110,7 @@ function openy_gc_log_update_8005() {
* Import configs and update entity.
*/
function openy_gc_log_update_8006() {
$config_dir = drupal_get_path('module', 'openy_gc_log');
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_gc_log');
$config_dir .= '/config/install/';
$config_importer = \Drupal::service('openy_upgrade_tool.importer');
$config_importer->setDirectory($config_dir);
Expand Down Expand Up @@ -152,7 +152,7 @@ function openy_gc_log_update_8007() {
* Import logs view config.
*/
function openy_gc_log_update_8008() {
$config_dir = drupal_get_path('module', 'openy_gc_log');
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_gc_log');
$config_dir .= '/config/install/';
$config_importer = \Drupal::service('openy_upgrade_tool.importer');
$config_importer->setDirectory($config_dir);
Expand All @@ -165,7 +165,7 @@ function openy_gc_log_update_8008() {
* Import activity logs view config.
*/
function openy_gc_log_update_8009() {
$config_dir = drupal_get_path('module', 'openy_gc_log');
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_gc_log');
$config_dir .= '/config/install/';
$config_importer = \Drupal::service('openy_upgrade_tool.importer');
$config_importer->setDirectory($config_dir);
Expand All @@ -178,7 +178,7 @@ function openy_gc_log_update_8009() {
* Import updated logs view config.
*/
function openy_gc_log_update_8010() {
$config_dir = drupal_get_path('module', 'openy_gc_log');
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_gc_log');
$config_dir .= '/config/install/';
$config_importer = \Drupal::service('openy_upgrade_tool.importer');
$config_importer->setDirectory($config_dir);
Expand All @@ -191,7 +191,7 @@ function openy_gc_log_update_8010() {
* Import updated logs view config.
*/
function openy_gc_log_update_8011() {
$config_dir = drupal_get_path('module', 'openy_gc_log');
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_gc_log');
$config_dir .= '/config/install/';
$config_importer = \Drupal::service('openy_upgrade_tool.importer');
$config_importer->setDirectory($config_dir);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ function openy_gc_personal_training_update_8001() {
* Import types, fields and forms configs.
*/
function openy_gc_personal_training_update_8002() {
$config_dir = drupal_get_path('module', 'openy_gc_personal_training');
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_gc_personal_training');
$config_dir .= '/config/install/';
// Import new configuration.
$config_importer = \Drupal::service('openy_upgrade_tool.importer');
Expand Down Expand Up @@ -137,7 +137,7 @@ function openy_gc_personal_training_update_8003() {
* Add email settings.
*/
function openy_gc_personal_training_update_8004(&$sandbox) {
$config_dir = drupal_get_path('module', 'openy_gc_personal_training');
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_gc_personal_training');
$config_dir .= '/config/install/';
$configs = [
'openy_gc_personal_training.settings' => [
Expand Down Expand Up @@ -248,7 +248,7 @@ function openy_gc_personal_training_update_8009() {
* Import view config.
*/
function openy_gc_personal_training_update_8010() {
$config_dir = drupal_get_path('module', 'openy_gc_personal_training');
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_gc_personal_training');
$config_dir .= '/config/install/';
// Import new configuration.
$config_importer = \Drupal::service('openy_upgrade_tool.importer');
Expand All @@ -269,7 +269,7 @@ function openy_gc_personal_training_update_8011() {
* Updated views with personal_trainings.
*/
function openy_gc_personal_training_update_8013() {
$config_dir = drupal_get_path('module', 'openy_gc_personal_training');
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_gc_personal_training');
$config_dir .= '/config/install/';
// Import new configuration.
$config_importer = \Drupal::service('openy_upgrade_tool.importer');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function openy_gc_personal_training_virtual_y_app_settings_alter(&$config) {
$config['peerjsTURNUsername'] = $moduleConfig->get('peerjs_turn_username');
$config['peerjsTURNCredential'] = $moduleConfig->get('peerjs_turn_credential');
$config['peerjsDebug'] = $moduleConfig->get('peerjs_debug');
$config['newMessageSound'] = drupal_get_path('module', 'openy_gc_personal_training') . '/assets/sound/new_message_sound.mp3';
$config['newMessageSound'] = \Drupal::service('extension.list.module')->getPath('openy_gc_personal_training') . '/assets/sound/new_message_sound.mp3';

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ public function buildBatch(int $id, array $methods): void {
->setProgressMessage($this->t('Completed @current of @total.'))
->setErrorMessage($this->t('An error has occurred.'))
->setProgressive(TRUE);
$this->batchBuilder->setFile(drupal_get_path('module', 'openy_gc_personal_training') . '/src/PersonalTrainingSeriesManager.php');
$this->batchBuilder->setFile(\Drupal::service('extension.list.module')->getPath('openy_gc_personal_training') . '/src/PersonalTrainingSeriesManager.php');
foreach ($methods as $method) {
$this->batchBuilder->addOperation([$this, $method], [$id]);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function openy_gc_shared_content_install() {
$definition_manager->installFieldStorageDefinition('field_gc_share', 'eventinstance', 'openy_gc_shared_content', $field_gc_share);
$definition_manager->installFieldStorageDefinition('field_gc_origin', 'eventinstance', 'openy_gc_shared_content', $field_gc_origin);

$config_dir = drupal_get_path('module', 'openy_gc_shared_content') . '/config/update/';
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_gc_shared_content') . '/config/update/';
$config_importer = \Drupal::service('openy_upgrade_tool.importer');
$config_importer->setDirectory($config_dir);
$config_importer->importConfigs([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ public function save(array $form, FormStateInterface $form_state) {
->setInitMessage($this->t('Initializing.'))
->setProgressMessage($this->t('Completed @current of @total.'))
->setErrorMessage($this->t('An error has occurred.'));
$this->batchBuilder->setFile(drupal_get_path('module', 'openy_gc_shared_content') . '/src/Form/SharedContentFetchForm.php');
$this->batchBuilder->setFile(\Drupal::service('extension.list.module')->getPath('openy_gc_shared_content') . '/src/Form/SharedContentFetchForm.php');
foreach ($to_create as $uuid) {
$this->batchBuilder->addOperation([$this, 'processItem'], [
$this->entity->getUrl(),
Expand Down
26 changes: 13 additions & 13 deletions modules/openy_gc_storage/openy_gc_storage.install
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function _openy_gc_storage_add_banner_image_style() {
* Add event link field description.
*/
function openy_gc_storage_update_8001() {
$config_dir = drupal_get_path('module', 'openy_gc_storage');
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_gc_storage');
$config_dir .= '/config/install/';
// Import new configuration.
$config_importer = \Drupal::service('openy_upgrade_tool.importer');
Expand All @@ -52,7 +52,7 @@ function openy_gc_storage_update_8001() {
* Add teaser image field to video.
*/
function openy_gc_storage_update_8002() {
$config_dir = drupal_get_path('module', 'openy_gc_storage');
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_gc_storage');
$config_dir .= '/config/install/';
// Import new configuration.
$config_importer = \Drupal::service('openy_upgrade_tool.importer');
Expand All @@ -70,7 +70,7 @@ function openy_gc_storage_update_8002() {
* Make video category multiple.
*/
function openy_gc_storage_update_8003() {
$config_dir = drupal_get_path('module', 'openy_gc_storage');
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_gc_storage');
$config_dir .= '/config/install/';
// Update configuration.
$config_importer = \Drupal::service('openy_upgrade_tool.importer');
Expand All @@ -84,7 +84,7 @@ function openy_gc_storage_update_8003() {
* Add category field to blog post + Make event category multiple.
*/
function openy_gc_storage_update_8004() {
$config_dir = drupal_get_path('module', 'openy_gc_storage');
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_gc_storage');
$config_dir .= '/config/install/';
// Update configuration.
$config_importer = \Drupal::service('openy_upgrade_tool.importer');
Expand Down Expand Up @@ -129,7 +129,7 @@ function openy_gc_storage_update_8004() {
* Add recurring event series config to set interval and start time.
*/
function openy_gc_storage_update_8005() {
$config_dir = drupal_get_path('module', 'openy_gc_storage');
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_gc_storage');
$config_dir .= '/config/install/';
// Update configuration.
$config_importer = \Drupal::service('openy_upgrade_tool.importer');
Expand Down Expand Up @@ -163,7 +163,7 @@ function openy_gc_storage_update_8006() {
*/
function openy_gc_storage_update_8007() {
/* These configs will be updated in openy_gc_storage_update_8016.
$config_dir = drupal_get_path('module', 'openy_gc_storage');
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_gc_storage');
$config_dir .= '/config/install/';
// Import new configuration.
$config_importer = \Drupal::service('openy_upgrade_tool.importer');
Expand All @@ -179,7 +179,7 @@ function openy_gc_storage_update_8007() {
* Update event link field description.
*/
function openy_gc_storage_update_8008() {
$config_dir = drupal_get_path('module', 'openy_gc_storage');
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_gc_storage');
$config_dir .= '/config/install/';
// Import new configuration.
$config_importer = \Drupal::service('openy_upgrade_tool.importer');
Expand All @@ -194,7 +194,7 @@ function openy_gc_storage_update_8008() {
* Update media descriptions.
*/
function openy_gc_storage_update_8009() {
$config_dir = drupal_get_path('module', 'openy_gc_storage');
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_gc_storage');
$config_dir .= '/config/install/';
// Import new configuration.
$config_importer = \Drupal::service('openy_upgrade_tool.importer');
Expand All @@ -209,7 +209,7 @@ function openy_gc_storage_update_8009() {
* Enabling scheduler module.
*/
function openy_gc_storage_update_8011() {
$config_dir = drupal_get_path('module', 'openy_gc_storage') . '/config/install/';
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_gc_storage') . '/config/install/';
// Update multiple configurations.
$configs = [
'node.type.gc_video' => [
Expand All @@ -234,7 +234,7 @@ function openy_gc_storage_update_8011() {
* Update image fields required.
*/
function openy_gc_storage_update_8013() {
$config_dir = drupal_get_path('module', 'openy_gc_storage');
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_gc_storage');
$config_dir .= '/config/install/';
// Import new configuration.
$config_importer = \Drupal::service('openy_upgrade_tool.importer');
Expand All @@ -249,7 +249,7 @@ function openy_gc_storage_update_8013() {
* Reimport event and event series views. Skip 8012-13 and do not copy code.
*/
function openy_gc_storage_update_8014() {
$config_dir = drupal_get_path('module', 'openy_gc_storage');
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_gc_storage');
$config_dir .= '/config/install/';
$config_importer = \Drupal::service('openy_upgrade_tool.importer');
$config_importer->setDirectory($config_dir);
Expand All @@ -270,7 +270,7 @@ function openy_gc_storage_update_8015() {
* Update and create configs related to the Instructor reference field.
*/
function openy_gc_storage_update_8016() {
$config_dir = drupal_get_path('module', 'openy_gc_storage');
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_gc_storage');
$config_dir .= '/config/install/';
// Update configuration.
$config_importer = \Drupal::service('openy_upgrade_tool.importer');
Expand Down Expand Up @@ -311,7 +311,7 @@ function openy_gc_storage_update_8016() {
* Update/create configs related to Duration reference field.
*/
function openy_gc_storage_update_8017() {
$config_dir = drupal_get_path('module', 'openy_gc_storage');
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_gc_storage');
$config_dir .= '/config/install/';
// Update configuration.
$config_importer = \Drupal::service('openy_upgrade_tool.importer');
Expand Down
Loading

0 comments on commit 397ff05

Please sign in to comment.