Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
drupal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
229
Merge Requests
229
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
drupal
Commits
1939de98
Commit
1939de98
authored
Feb 07, 2014
by
webchick
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#2191323
by Cottser: Item-list.html.twig always shows empty text.
parent
eeb7c103
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletion
+10
-1
core/modules/system/lib/Drupal/system/Tests/Theme/FunctionsTest.php
...es/system/lib/Drupal/system/Tests/Theme/FunctionsTest.php
+8
-0
core/modules/system/templates/item-list.html.twig
core/modules/system/templates/item-list.html.twig
+2
-1
No files found.
core/modules/system/lib/Drupal/system/Tests/Theme/FunctionsTest.php
View file @
1939de98
...
...
@@ -60,6 +60,14 @@ function testItemList() {
$expected
=
'<div class="item-list"><h3>Some title</h3>No items found.</div>'
;
$this
->
assertThemeOutput
(
'item_list'
,
$variables
,
$expected
,
'Empty %callback generates empty string with title.'
);
// Verify that empty text is not displayed when there are list items.
$variables
=
array
();
$variables
[
'title'
]
=
'Some title'
;
$variables
[
'empty'
]
=
'No items found.'
;
$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>'
;
$this
->
assertThemeOutput
(
'item_list'
,
$variables
,
$expected
,
'%callback does not print empty text when there are list items.'
);
// Verify nested item lists.
$variables
=
array
();
$variables
[
'title'
]
=
'Some title'
;
...
...
core/modules/system/templates/item-list.html.twig
View file @
1939de98
...
...
@@ -29,7 +29,8 @@
<li
{{
item.attributes
}}
>
{{
item.value
}}
</li>
{%
-
endfor
-
%}
</
{{
list_type
}}
>
{%
-
else
-
%}
{{
-
empty
-
}}
{%
-
endif
-
%}
{{
-
empty
-
}}
</div>
{%
-
endif
%}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment