Skip to content

Commit

Permalink
ACMS-3658: The drs:init:settings command shouldn't be called when DRS…
Browse files Browse the repository at this point in the history
… updated.
  • Loading branch information
vishalkhode1 committed Mar 22, 2024
1 parent 71b246a commit be0d353
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
4 changes: 0 additions & 4 deletions src/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use Composer\Composer;
use Composer\DependencyResolver\Operation\InstallOperation;
use Composer\DependencyResolver\Operation\OperationInterface;
use Composer\DependencyResolver\Operation\UpdateOperation;
use Composer\EventDispatcher\EventSubscriberInterface;
use Composer\Installer\PackageEvent;
use Composer\Installer\PackageEvents;
Expand Down Expand Up @@ -119,9 +118,6 @@ protected function getSettingsPackage(OperationInterface $operation): mixed {
if ($operation instanceof InstallOperation) {
$package = $operation->getPackage();
}
elseif ($operation instanceof UpdateOperation) {
$package = $operation->getTargetPackage();
}
if (isset($package) && $package instanceof PackageInterface && $package->getName() == "acquia/drupal-recommended-settings") {
return $package;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/src/unit/PluginUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public function testGetSettingsPackage(): void {
$this->plugin->onPostPackageEvent($package_event);
$method = $this->getReflectionMethod(Plugin::class, "getSettingsPackage");
$package_name = $method->invokeArgs($this->plugin, [$operation]);
$this->assertEquals("acquia/drupal-recommended-settings-1.0", $package_name);
$this->assertNull($package_name);

// Assert when any other package is installed.
$package = new RootPackage("acquia/blt", "14.0", "14.0.0");
Expand Down

0 comments on commit be0d353

Please sign in to comment.