The template committed in #1939062: Convert theme_item_list() to Twig was missing logic to only display the empty text when no results were found. This made #1926344: Consolidate search-result.html.twig and search-results.html.twig break HEAD.

This follow-up issue is to fix the bug in the template and add more test coverage for the relatively new functionality added by #2120807: Add empty option to item_list.

#1 2191323-1.patch1.63 KBCottser
PASSED: [[SimpleTest]]: [MySQL] 63,691 pass(es). View
#1 2191323-1-testonly.patch1.15 KBCottser
FAILED: [[SimpleTest]]: [MySQL] 63,771 pass(es), 1 fail(s), and 0 exception(s). View
Members fund testing for the Drupal project. Drupal Association Learn more


Cottser’s picture

Assigned: Cottser » Unassigned
Status: Active » Needs review
1.15 KB
FAILED: [[SimpleTest]]: [MySQL] 63,771 pass(es), 1 fail(s), and 0 exception(s). View
1.63 KB
PASSED: [[SimpleTest]]: [MySQL] 63,691 pass(es). View

Here we go.

webchick’s picture

Heh. I actually saw that last night, but thought it was some Twig-ism I wasn't familiar with. Oops. :P

jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

Looks pretty straightforward to me. Assuming the testbot agrees that TestOnly fails and Patch passes, this should be good to go.

joelpittet’s picture


The last submitted patch, 1: 2191323-1-testonly.patch, failed testing.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed to 8.x. Thanks!

jibran’s picture

+++ b/core/modules/system/lib/Drupal/system/Tests/Theme/FunctionsTest.php
@@ -60,6 +60,14 @@ function testItemList() {
+    $variables['items'] = array('Un', 'Deux', 'Trois');
+    $expected = '<div class="item-list"><h3>Some title</h3><ul><li>Un</li><li>Deux</li><li>Trois</li></ul></div>';

Now I can count in french because of #Drupal core. Thank you @Cottser.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.