Skip to content
Snippets Groups Projects
Commit 13de2fed authored by Ted Bowman's avatar Ted Bowman
Browse files

Issue #3435893: SupportedReleaseValidator does not provide translatable messages for all errors

parent 73009dfd
No related branches found
No related tags found
1 merge request!1041Issue #3435893 make unknown_packages translatable
Pipeline #135958 passed with warnings
......@@ -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),
],
),
]);
}
}
......
......@@ -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')]),
],
],
];
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment