diff -u b/core/modules/system/src/Form/ModulesListForm.php b/core/modules/system/src/Form/ModulesListForm.php --- b/core/modules/system/src/Form/ModulesListForm.php +++ b/core/modules/system/src/Form/ModulesListForm.php @@ -147,7 +147,7 @@ uasort($modules, 'system_sort_modules_by_info_name'); } catch (InfoParserException $e) { - $this->messenger()->addError($this->t('Modules could not be listed due to an error: "%error"', ['%error' => $e->getMessage()])); + $this->messenger()->addError($this->t('Modules can not be listed due to an error: %error', [%error => $e->getMessage()])); $modules = []; } diff -u b/core/modules/system/tests/src/Functional/Form/ModulesListFormWebTest.php b/core/modules/system/tests/src/Functional/Form/ModulesListFormWebTest.php --- b/core/modules/system/tests/src/Functional/Form/ModulesListFormWebTest.php +++ b/core/modules/system/tests/src/Functional/Form/ModulesListFormWebTest.php @@ -70,7 +70,7 @@ // Confirm that the error message is shown. $this->assertSession() - ->pageTextContains('Modules could not be listed due to an error: "Missing required keys (core) in ' . $path . '/broken.info.yml"'); + ->pageTextContains('Modules can not be listed due to an error: "Missing required keys (core) in ' . $path . '/broken.info.yml"'); // Check that the module filter text box is available. $this->assertTrue($this->xpath('//input[@name="text"]'));