diff --git a/core/modules/system/js/system.modules.js b/core/modules/system/js/system.modules.js index 2c993da0f01d8acc176f5fe8fb565d419a5a7ffc..44bdf336b371192bc67a1362b1897fa8b59d311c 100644 --- a/core/modules/system/js/system.modules.js +++ b/core/modules/system/js/system.modules.js @@ -44,9 +44,10 @@ '.table-filter-text-source, .module-name, .module-description', ); let sourcesConcat = ''; - // Concatenate the textContent of the elements in the row. + // Concatenate the textContent of the elements in the row, with a + // space in between. sources.forEach((item) => { - sourcesConcat += item.textContent; + sourcesConcat += ` ${item.textContent}`; }); const textMatch = sourcesConcat.search(re) !== -1; $(row).closest('tr').toggle(textMatch); diff --git a/core/modules/system/tests/src/FunctionalJavascript/ModuleFilterTest.php b/core/modules/system/tests/src/FunctionalJavascript/ModuleFilterTest.php index 1dd3e48fdb87d79d2b58ce340cca6808e4fadcb2..e9ce2901c07e6ec865942f60777751fb146ce68c 100644 --- a/core/modules/system/tests/src/FunctionalJavascript/ModuleFilterTest.php +++ b/core/modules/system/tests/src/FunctionalJavascript/ModuleFilterTest.php @@ -68,6 +68,14 @@ public function testModuleFilter() { $expected_message = '1 module is available in the modified list.'; $assertSession->elementTextContains('css', '#drupal-live-announce', $expected_message); + // Test filtering by a machine name, when the module description doesn't end + // with a period or other separator. This condition is common for test + // modules. + $filter->setValue('comment_base_field_test'); + $session->wait(1000, 'jQuery("#module-node:visible").length == 0'); + $visible_rows = $this->filterVisibleElements($module_rows); + self::assertEquals(1, count($visible_rows)); + // Test Drupal.announce() message when no matches are expected. $filter->setValue('Pan-Galactic Gargle Blaster'); $session->wait(1000, 'jQuery("#module-node:visible").length == 0');