Skip to content

Commit c6b3664

Browse files
ACMS-4414: Update base package import config action to import base packages only.
1 parent c23b838 commit c6b3664

File tree

3 files changed

+0
-41
lines changed

3 files changed

+0
-41
lines changed

modules/acquia_cms_site_studio/acquia_cms_site_studio.services.yml

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ services:
33
class: Drupal\acquia_cms_site_studio\Services\DefaultRecipePackage
44
arguments:
55
- '@module_handler'
6-
- '@extension.path.resolver'
76
- '@config.factory'
87
tags:
98
- { name: sitestudio_package_source, priority: 50 }

modules/acquia_cms_site_studio/src/Plugin/ConfigAction/BasePackageImport.php

-28
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
namespace Drupal\acquia_cms_site_studio\Plugin\ConfigAction;
66

77
use Drupal\cohesion\Controller\AdministrationController;
8-
use Drupal\cohesion_sync\Services\PackageImportHandler;
98
use Drupal\Component\Render\PlainTextOutput;
109
use Drupal\Core\Config\Action\Attribute\ConfigAction;
1110
use Drupal\Core\Config\Action\ConfigActionPluginInterface;
@@ -35,15 +34,12 @@ final class BasePackageImport implements ConfigActionPluginInterface, ContainerF
3534
* The config factory.
3635
* @param \Drupal\Core\Site\Settings $settings
3736
* The settings.
38-
* @param \Drupal\cohesion_sync\Services\PackageImportHandler $packageImportHandler
39-
* The package import handler.
4037
* @param \Drupal\Core\Extension\ModuleHandler $moduleHandler
4138
* The module handler.
4239
*/
4340
public function __construct(
4441
protected readonly ConfigFactoryInterface $configFactory,
4542
protected readonly Settings $settings,
46-
protected readonly PackageImportHandler $packageImportHandler,
4743
protected readonly ModuleHandler $moduleHandler,
4844
) {
4945
}
@@ -55,7 +51,6 @@ public static function create(ContainerInterface $container, array $configuratio
5551
return new static(
5652
$container->get('config.factory'),
5753
$container->get('settings'),
58-
$container->get('cohesion_sync.package_import_handler'),
5954
$container->get('module_handler'),
6055
);
6156
}
@@ -129,8 +124,6 @@ private function toPlainString(\Stringable|string $text): string {
129124
*/
130125
private function importBasePackages(): void {
131126
$this->initializeBatch();
132-
$package_list_path = $this->getPackageListPath();
133-
$this->importPackages($package_list_path);
134127
$this->processBatchIfCli();
135128
}
136129

@@ -141,27 +134,6 @@ private function initializeBatch(): void {
141134
batch_set(AdministrationController::batchAction(TRUE));
142135
}
143136

144-
/**
145-
* Gets the path to the package list file.
146-
*
147-
* @return string
148-
* The path to the package list file.
149-
*/
150-
private function getPackageListPath(): string {
151-
$module_path = $this->moduleHandler->getModule('acquia_cms_site_studio')->getPath();
152-
return $module_path . '/config/site_studio/site_studio.packages.yml';
153-
}
154-
155-
/**
156-
* Imports packages from the specified path.
157-
*
158-
* @param string $package_list_path
159-
* The path to the package list file.
160-
*/
161-
private function importPackages(string $package_list_path): void {
162-
$this->packageImportHandler->importPackagesFromPath($package_list_path);
163-
}
164-
165137
/**
166138
* Processes the batch if running in CLI mode.
167139
*/

modules/acquia_cms_site_studio/src/Services/DefaultRecipePackage.php

-12
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
use Drupal\Core\Extension\MissingDependencyException;
99
use Drupal\Core\Extension\ModuleHandlerInterface;
1010
use Drupal\Core\File\Exception\DirectoryNotReadyException;
11-
use Drupal\Core\Extension\ExtensionPathResolver;
1211

1312
/**
1413
* Default Recipe Package service.
@@ -25,13 +24,6 @@ class DefaultRecipePackage implements PackageSourceServiceInterface {
2524
*/
2625
protected $moduleHandler;
2726

28-
/**
29-
* Factory for getting extension lists by type.
30-
*
31-
* @var \Drupal\Core\Extension\ExtensionPathResolver
32-
*/
33-
protected $extensionPathResolver;
34-
3527
/**
3628
* The config factory object.
3729
*
@@ -44,18 +36,14 @@ class DefaultRecipePackage implements PackageSourceServiceInterface {
4436
*
4537
* @param \Drupal\Core\Extension\ModuleHandlerInterface $moduleHandler
4638
* Module handler service.
47-
* @param \Drupal\Core\Extension\ExtensionPathResolver $extensionPathResolver
48-
* Factory for getting extension lists by type.
4939
* @param \Drupa\Core\ConfigFactoryInterface $configFactory
5040
* The config factory.
5141
*/
5242
public function __construct(
5343
ModuleHandlerInterface $moduleHandler,
54-
ExtensionPathResolver $extensionPathResolver,
5544
ConfigFactoryInterface $configFactory,
5645
) {
5746
$this->moduleHandler = $moduleHandler;
58-
$this->extensionPathResolver = $extensionPathResolver;
5947
$this->configFactory = $configFactory;
6048
}
6149

0 commit comments

Comments
 (0)