diff --git a/package_manager/src/Validator/SupportedReleaseValidator.php b/package_manager/src/Validator/SupportedReleaseValidator.php index 176da4ed887318a5667d0d4ae509748b2dff798a..8f159802fa5178c9085a53f6506eaf8f16c7899f 100644 --- a/package_manager/src/Validator/SupportedReleaseValidator.php +++ b/package_manager/src/Validator/SupportedReleaseValidator.php @@ -121,12 +121,16 @@ final class SupportedReleaseValidator implements EventSubscriberInterface { $event->addError($unsupported_packages, $summary); } if ($unknown_packages) { - $summary = $this->formatPlural( - count($unknown_packages), - 'Cannot update because the following new or updated Drupal package does not have project information.', - 'Cannot update because the following new or updated Drupal packages do not have project information.', - ); - $event->addError($unknown_packages, $summary); + $event->addError([ + $this->formatPlural( + count($unknown_packages), + 'Cannot update because the following new or updated Drupal package does not have project information: @unknown_packages', + 'Cannot update because the following new or updated Drupal packages do not have project information: @unknown_packages', + [ + '@unknown_packages' => implode(', ', $unknown_packages), + ], + ), + ]); } } diff --git a/package_manager/tests/src/Kernel/SupportedReleaseValidatorTest.php b/package_manager/tests/src/Kernel/SupportedReleaseValidatorTest.php index 6cf8701d5e67f813c6d2768f3d6543fa2a90b277..156ba3630c84c58c852835e6746365c46f74442e 100644 --- a/package_manager/tests/src/Kernel/SupportedReleaseValidatorTest.php +++ b/package_manager/tests/src/Kernel/SupportedReleaseValidatorTest.php @@ -49,6 +49,18 @@ class SupportedReleaseValidatorTest extends PackageManagerKernelTestBase { 'version' => '8.1.0', 'type' => 'drupal-module', ]) + ->addPackage( + [ + 'name' => "drupal/module_no_project", + 'version' => '1.0.0', + 'type' => 'drupal-module', + ], + FALSE, + FALSE, + [ + 'module_no_project.info.yml' => '{name: "Module No Project", type: "module"}', + ], + ) ->commitChanges(); } @@ -179,6 +191,18 @@ class SupportedReleaseValidatorTest extends PackageManagerKernelTestBase { ], [], ], + 'updating a module that does not have project info' => [ + [], + TRUE, + [ + 'name' => "drupal/module_no_project", + 'version' => '1.1.0', + 'type' => 'drupal-module', + ], + [ + ValidationResult::createError([t('Cannot update because the following new or updated Drupal package does not have project information: drupal/module_no_project')]), + ], + ], ]; }