Skip to content

Commit

Permalink
fix(deprecated,upgrade): Merge pull request #18 from shuklina/RGTC-1875
Browse files Browse the repository at this point in the history
[RGTC-1875] Replace drupal_get_path
  • Loading branch information
podarok authored Jan 5, 2022
2 parents 66eadb1 + 995c377 commit 721c328
Show file tree
Hide file tree
Showing 78 changed files with 333 additions and 333 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* Update description for field and block.
*/
function openy_block_basic_update_8001() {
$config_dir = drupal_get_path('module', 'openy_block_basic') . '/config/install/';
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_block_basic') . '/config/install/';
// Update multiple configurations.
$configs = [
'block_content.type.basic_block' => [
Expand All @@ -33,7 +33,7 @@ function openy_block_basic_update_8001() {
* Update configs for Drupal Core upgrade.
*/
function openy_block_basic_update_8002() {
$config_dir = drupal_get_path('module', 'openy_block_basic') . '/config/install/';
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_block_basic') . '/config/install/';
// Update multiple configurations.
$configs = [
'core.entity_form_display.block_content.basic_block.default' => [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* Update configs for Drupal Core upgrade.
*/
function openy_block_branch_amenities_update_8001() {
$config_dir = drupal_get_path('module', 'openy_block_branch_amenities') . '/config/install/';
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_block_branch_amenities') . '/config/install/';
// Update multiple configurations.
$configs = [
'core.entity_form_display.block_content.branch_amenities.default' => [
Expand All @@ -32,7 +32,7 @@ function openy_block_branch_amenities_update_8001() {
*/
function openy_block_branch_amenities_update_8002()
{
$config_dir = drupal_get_path('module', 'openy_block_branch_amenities') . '/config/install/';
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_block_branch_amenities') . '/config/install/';
$config_importer = \Drupal::service('openy_upgrade_tool.importer');
$config_importer->setDirectory($config_dir);
$config_importer->importConfigs([
Expand All @@ -48,7 +48,7 @@ function openy_block_branch_amenities_update_8002()
* Update Open Y Block Branch Amenities feature to use link attributes widget.
*/
function openy_block_branch_amenities_update_8003() {
$config_dir = drupal_get_path('module', 'openy_block_branch_amenities') . '/config/install/';
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_block_branch_amenities') . '/config/install/';
// Update multiple configurations.
$configs = [
'core.entity_form_display.block_content.branch_amenities.default' =>[
Expand All @@ -70,7 +70,7 @@ function openy_block_branch_amenities_update_8003() {
* Update configs for remove custom formatters.
*/
function openy_block_branch_amenities_update_8004() {
$config_dir = drupal_get_path('module', 'openy_block_branch_amenities') . '/config/install/';
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_block_branch_amenities') . '/config/install/';
// Update multiple configurations.
$configs = [
'core.entity_view_display.block_content.branch_amenities.default' => [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* Creates new Paragraph Type "Branch Contacts Info".
*/
function openy_block_branch_contacts_info_install() {
$config_dir = drupal_get_path('module', 'openy_block_branch_contacts_info') . '/config/install/';
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_block_branch_contacts_info') . '/config/install/';
// Update multiple configurations.
$configs = [
'core.entity_form_display.paragraph.branch_contacts_info.default',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
function openy_block_custom_simple_update_8001() {
/** @var \Drupal\openy_upgrade_tool\ConfigParamUpgradeTool $config_importer */
$config_importer = \Drupal::service('openy_upgrade_tool.param_updater');
$config = drupal_get_path('module', 'openy_block_custom_simple');
$config = \Drupal::service('extension.list.module')->getPath('openy_block_custom_simple');
$config .= '/config/install/';
$config .= 'core.entity_form_display.block_content.simple_block.default.yml';
$config_importer->update(
Expand All @@ -25,7 +25,7 @@ function openy_block_custom_simple_update_8001() {
* Update configs for Drupal Core upgrade.
*/
function openy_block_custom_simple_update_8002() {
$config_dir = drupal_get_path('module', 'openy_block_custom_simple') . '/config/install/';
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_block_custom_simple') . '/config/install/';
// Update multiple configurations.
$configs = [
'core.entity_form_display.block_content.simple_block.default' => [
Expand All @@ -46,7 +46,7 @@ function openy_block_custom_simple_update_8002() {
* Update Open Y Block Custom Simple feature to use link attributes widget.
*/
function openy_block_custom_simple_update_8003() {
$config_dir = drupal_get_path('module', 'openy_block_custom_simple') . '/config/install/';
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_block_custom_simple') . '/config/install/';
// Update multiple configurations.
$configs = [
'core.entity_form_display.block_content.simple_block.default' =>[
Expand Down
4 changes: 2 additions & 2 deletions openy_block/modules/openy_block_date/openy_block_date.install
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* Update configs for Drupal Core upgrade.
*/
function openy_block_date_update_8001() {
$config_dir = drupal_get_path('module', 'openy_block_date') . '/config/install/';
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_block_date') . '/config/install/';
// Update multiple configurations.
$configs = [
'core.entity_form_display.block_content.date_block.default' => [
Expand All @@ -30,7 +30,7 @@ function openy_block_date_update_8001() {
* Update fields instances settings.
*/
function openy_block_date_update_8002() {
$config_dir = drupal_get_path('module', 'openy_block_date') . '/config/install/';
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_block_date') . '/config/install/';
// Update multiple configurations.
$configs = [
'field.field.block_content.date_block.field_content_date_between' => [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* Update Open Y Featured Highlights feature to use link attributes widget.
*/
function openy_block_featured_highlights_update_8001() {
$config_dir = drupal_get_path('module', 'openy_block_featured_highlights') . '/config/install/';
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_block_featured_highlights') . '/config/install/';
// Update multiple configurations.
$configs = [
'core.entity_form_display.block_content.featured_highlights_block.default' =>[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* Update configs for Drupal Core upgrade.
*/
function openy_block_flexible_content_update_8001() {
$config_dir = drupal_get_path('module', 'openy_block_flexible_content') . '/config/install/';
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_block_flexible_content') . '/config/install/';
// Update multiple configurations.
$configs = [
'core.entity_form_display.block_content.flexible_content.default' => [
Expand Down
4 changes: 2 additions & 2 deletions openy_block/modules/openy_block_menu/openy_block_menu.install
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function openy_block_menu_update_8001() {
* Update configs for Drupal Core upgrade.
*/
function openy_block_menu_update_8002() {
$config_dir = drupal_get_path('module', 'openy_block_menu') . '/config/install/';
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_block_menu') . '/config/install/';
// Update multiple configurations.
$configs = [
'core.entity_form_display.block_content.menu_block.default' => [
Expand All @@ -38,7 +38,7 @@ function openy_block_menu_update_8002() {
* Update Open Y Block Menu feature to use link attributes widget.
*/
function openy_block_menu_update_8003() {
$config_dir = drupal_get_path('module', 'openy_block_menu') . '/config/install/';
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_block_menu') . '/config/install/';
// Update multiple configurations.
$configs = [
'core.entity_form_display.block_content.menu_block.default' => [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* Update configs for Drupal Core upgrade.
*/
function openy_code_block_update_8001() {
$config_dir = drupal_get_path('module', 'openy_code_block') . '/config/install/';
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_code_block') . '/config/install/';
// Update multiple configurations.
$configs = [
'core.entity_form_display.block_content.code_block.default' => [
Expand Down
2 changes: 1 addition & 1 deletion openy_block/openy_block.install
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*/
function openy_block_update_8001() {
$config_importer = \Drupal::service('openy_upgrade_tool.param_updater');
$config_path = drupal_get_path('module', 'openy_block') . '/config/install/';
$config_path = \Drupal::service('extension.list.module')->getPath('openy_block') . '/config/install/';
$config = 'field.storage.block_content.field_block_content';
$config_importer->update($config_path . $config . '.yml',
$config,
Expand Down
4 changes: 2 additions & 2 deletions openy_editor/openy_editor.install
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Update Open Y editor feature configs.
*/
function openy_editor_update_8001() {
$config_dir = drupal_get_path('module', 'openy_editor') . '/config/install/';
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_editor') . '/config/install/';
// Update multiple configurations.
$configs = [
'filter.format.full_html' => [
Expand All @@ -31,7 +31,7 @@ function openy_editor_update_8001() {
* Update editor settings to add local video embed button.
*/
function openy_editor_update_8002() {
$config = drupal_get_path('module', 'openy_editor') . '/config/install/editor.editor.full_html.yml';
$config = \Drupal::service('extension.list.module')->getPath('openy_editor') . '/config/install/editor.editor.full_html.yml';
$config_importer = \Drupal::service('openy_upgrade_tool.param_updater');
$config_importer->update($config, 'editor.editor.full_html', 'settings.toolbar.rows');
}
Expand Down
44 changes: 22 additions & 22 deletions openy_location/modules/openy_loc_branch/openy_loc_branch.install
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function openy_loc_branch_update_8001() {
];
$config_importer = \Drupal::service('openy_upgrade_tool.param_updater');
foreach ($configs as $config_name) {
$config = drupal_get_path('module', 'openy_loc_branch');
$config = \Drupal::service('extension.list.module')->getPath('openy_loc_branch');
$config .= '/config/install/' . $config_name . '.yml';
$config_importer->update($config,
$config_name,
Expand All @@ -64,7 +64,7 @@ function openy_loc_branch_update_8001() {
* Update Branch with field_bottom_content.
*/
function openy_loc_branch_update_8002() {
$config_dir = drupal_get_path('module', 'openy_loc_branch') . '/config/install/';
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_loc_branch') . '/config/install/';
// Import new configuration
$config_importer = \Drupal::service('openy_upgrade_tool.importer');
$config_importer->setDirectory($config_dir);
Expand Down Expand Up @@ -97,19 +97,19 @@ function openy_loc_branch_update_8003() {
$module = 'openy_loc_branch';
$bundle = 'branch';
// Field definitions
$config_dir = drupal_get_path('module', $module) . '/config/install';
$config_dir = \Drupal::service('extension.list.module')->getPath($module) . '/config/install';
$config_importer = \Drupal::service('openy_upgrade_tool.importer');
$config_importer->setDirectory($config_dir);
$config_importer->importConfigs([
'field.field.node.' . $bundle . '.field_meta_tags',
'simple_sitemap.bundle_settings.' . $bundle . '.landing_page',
]);
// Dependencies
$config = drupal_get_path('module', $module) . $module . '.info.yml';
$config = \Drupal::service('extension.list.module')->getPath($module) . $module . '.info.yml';
$config_importer = \Drupal::service('openy_upgrade_tool.param_updater');
$config_importer->update($config, $module . '.info', 'dependencies');
// Entity view display
$config = drupal_get_path('module', $module) . '/config/install/core.entity_view_display.node.' . $bundle . '.default.yml';
$config = \Drupal::service('extension.list.module')->getPath($module) . '/config/install/core.entity_view_display.node.' . $bundle . '.default.yml';
$config_importer = \Drupal::service('openy_upgrade_tool.param_updater');
$config_importer->update($config, 'core.entity_view_display.node.' . $bundle . '.default', 'dependencies.module');
}
Expand All @@ -118,7 +118,7 @@ function openy_loc_branch_update_8003() {
* Update Branch for class location view display.
*/
function openy_loc_branch_update_8004() {
$config_dir = drupal_get_path('module', 'openy_loc_branch') . '/config/install/';
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_loc_branch') . '/config/install/';
// Import new configuration
$config_importer = \Drupal::service('openy_upgrade_tool.importer');
$config_importer->setDirectory($config_dir);
Expand Down Expand Up @@ -150,7 +150,7 @@ function openy_loc_branch_update_8004() {
* Update Branch for rabbit hole, hiding pages from anonymous users.
*/
function openy_loc_branch_update_8005() {
$config_dir = drupal_get_path('module', 'openy_loc_branch') . '/config/install/';
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_loc_branch') . '/config/install/';
// Import new configuration
$config_importer = \Drupal::service('openy_upgrade_tool.importer');
$config_importer->setDirectory($config_dir);
Expand All @@ -163,7 +163,7 @@ function openy_loc_branch_update_8005() {
* Update view display for facility page.
*/
function openy_loc_branch_update_8006() {
$config_dir = drupal_get_path('module', 'openy_loc_branch') . '/config/install/';
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_loc_branch') . '/config/install/';
// Import new configuration
$config_importer = \Drupal::service('openy_upgrade_tool.importer');
$config_importer->setDirectory($config_dir);
Expand All @@ -177,7 +177,7 @@ function openy_loc_branch_update_8006() {
*/
function openy_loc_branch_update_8007() {
$config_importer = \Drupal::service('openy_upgrade_tool.param_updater');
$config = drupal_get_path('module', 'openy_loc_branch');
$config = \Drupal::service('extension.list.module')->getPath('openy_loc_branch');
$config .= '/config/install/';
$config .= 'field.field.node.branch.field_meta_tags.yml';
$config_importer->update(
Expand All @@ -192,7 +192,7 @@ function openy_loc_branch_update_8007() {
*/
function openy_loc_branch_update_8008() {
$config_importer = \Drupal::service('openy_upgrade_tool.param_updater');
$config = drupal_get_path('module', 'openy_loc_branch');
$config = \Drupal::service('extension.list.module')->getPath('openy_loc_branch');
$config .= '/config/install/';
$config .= 'core.entity_form_display.node.branch.default.yml';
$config_importer->update(
Expand All @@ -213,7 +213,7 @@ function openy_loc_branch_update_8009() {
* Import new amenities config and update older.
*/
function openy_loc_branch_update_8010() {
$config_dir = drupal_get_path('module', 'openy_loc_branch') . '/config/install/';
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_loc_branch') . '/config/install/';
// Update multiple configurations.
$configs = [
'core.entity_form_display.node.branch.default' => [
Expand All @@ -237,7 +237,7 @@ function openy_loc_branch_update_8010() {
* Import tour config for CT Branch.
*/
function openy_loc_branch_update_8011() {
$config_dir = drupal_get_path('module', 'openy_loc_branch') . '/config/install/';
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_loc_branch') . '/config/install/';
// Import new configuration
$config_importer = \Drupal::service('openy_upgrade_tool.importer');
$config_importer->setDirectory($config_dir);
Expand All @@ -258,7 +258,7 @@ function openy_loc_branch_update_8012() {
* Fixing configs.
*/
function openy_loc_branch_update_8013() {
$config_dir = drupal_get_path('module', 'openy_loc_branch') . '/config/install/';
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_loc_branch') . '/config/install/';
// Import new configuration
$config_importer = \Drupal::service('openy_upgrade_tool.importer');
$config_importer->setDirectory($config_dir);
Expand Down Expand Up @@ -287,7 +287,7 @@ function openy_loc_branch_update_8013() {
* Update Open Y branch location paragraph feature configs.
*/
function openy_loc_branch_update_8014() {
$config_dir = drupal_get_path('module', 'openy_loc_branch') . '/config/install/';
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_loc_branch') . '/config/install/';
// Update multiple configurations.
$configs = [
'core.entity_view_display.node.branch.class_location' => [
Expand Down Expand Up @@ -324,7 +324,7 @@ function openy_loc_branch_update_8014() {
* Update feature configs for Drupal Core upgrade.
*/
function openy_loc_branch_update_8015() {
$config_dir = drupal_get_path('module', 'openy_loc_branch') . '/config/install/';
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_loc_branch') . '/config/install/';
// Update multiple configurations.
$configs = [
'core.entity_form_display.node.branch.default' => [
Expand All @@ -347,7 +347,7 @@ function openy_loc_branch_update_8015() {
* Update feature configs.
*/
function openy_loc_branch_update_8016() {
$config_dir = drupal_get_path('module', 'openy_loc_branch') . '/config/install/';
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_loc_branch') . '/config/install/';
$config_importer = \Drupal::service('openy_upgrade_tool.importer');
$config_importer->setDirectory($config_dir);
$config_importer->importConfigs([
Expand All @@ -359,7 +359,7 @@ function openy_loc_branch_update_8016() {
* Update Branch with field_location_email.
*/
function openy_loc_branch_update_8017() {
$config_dir = drupal_get_path('module', 'openy_loc_branch') . '/config/install/';
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_loc_branch') . '/config/install/';

// Update multiple configurations.
$configs = [
Expand All @@ -383,7 +383,7 @@ function openy_loc_branch_update_8017() {
*/
function openy_loc_branch_update_8018() {
$config_importer = \Drupal::service('openy_upgrade_tool.param_updater');
$config = drupal_get_path('module', 'openy_loc_branch') . '/config/install/';
$config = \Drupal::service('extension.list.module')->getPath('openy_loc_branch') . '/config/install/';
$config .= 'core.entity_form_display.node.branch.default.yml';
$config_importer->update($config, 'core.entity_form_display.node.branch.default', 'third_party_settings.field_group.group_branch_amenities');
}
Expand All @@ -392,7 +392,7 @@ function openy_loc_branch_update_8018() {
* Add Closed Amenities field.
*/
function openy_loc_branch_update_8019() {
$config_dir = drupal_get_path('module', 'openy_loc_branch') . '/config/install/';
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_loc_branch') . '/config/install/';
$config_importer = \Drupal::service('openy_upgrade_tool.importer');
$config_importer->setDirectory($config_dir);
$config_importer->importConfigs([
Expand Down Expand Up @@ -421,7 +421,7 @@ function openy_loc_branch_update_8019() {
* Update Open Y Branch feature to use link attributes widget.
*/
function openy_loc_branch_update_8020() {
$config_dir = drupal_get_path('module', 'openy_loc_branch') . '/config/install/';
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_loc_branch') . '/config/install/';
// Update multiple configurations.
$configs = [
'core.entity_form_display.node.branch.default' =>[
Expand All @@ -445,7 +445,7 @@ function openy_loc_branch_update_8020() {
* Update teaser view mode configs.
*/
function openy_loc_branch_update_8021() {
$config_dir = drupal_get_path('module', 'openy_loc_branch') . '/config/install/';
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_loc_branch') . '/config/install/';
$config_importer = \Drupal::service('openy_upgrade_tool.importer');
$config_importer->setDirectory($config_dir);
$config_importer->importConfigs([
Expand All @@ -457,7 +457,7 @@ function openy_loc_branch_update_8021() {
* Update Open Y Branch feature to set coordinates as required field.
*/
function openy_loc_branch_update_8023() {
$config_dir = drupal_get_path('module', 'openy_loc_branch') . '/config/install/';
$config_dir = \Drupal::service('extension.list.module')->getPath('openy_loc_branch') . '/config/install/';
// Update multiple configurations.
$configs = [
'field.field.node.branch.field_location_coordinates' =>[
Expand Down
Loading

0 comments on commit 721c328

Please sign in to comment.