Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal-3443205
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
drupal-3443205
Commits
59eb794a
Unverified
Commit
59eb794a
authored
6 years ago
by
Alex Pott
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#2935360
by Lendude, Kirst25: Views result summary still renders when there's no results
parent
ecadaba6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
core/modules/views/src/Plugin/views/area/Result.php
+6
-4
6 additions, 4 deletions
core/modules/views/src/Plugin/views/area/Result.php
core/modules/views/tests/src/Kernel/Handler/AreaResultTest.php
+3
-0
3 additions, 0 deletions
...modules/views/tests/src/Kernel/Handler/AreaResultTest.php
with
9 additions
and
4 deletions
core/modules/views/src/Plugin/views/area/Result.php
+
6
−
4
View file @
59eb794a
...
...
@@ -115,11 +115,13 @@ public function render($empty = FALSE) {
// Send the output.
if
(
!
empty
(
$total
)
||
!
empty
(
$this
->
options
[
'empty'
]))
{
$output
.
=
Xss
::
filterAdmin
(
str_replace
(
array_keys
(
$replacements
),
array_values
(
$replacements
),
$format
));
// Return as render array.
return
[
'#markup'
=>
$output
,
];
}
// Return as render array.
return
[
'#markup'
=>
$output
,
];
return
[];
}
}
This diff is collapsed.
Click to expand it.
core/modules/views/tests/src/Kernel/Handler/AreaResultTest.php
+
3
−
0
View file @
59eb794a
...
...
@@ -57,6 +57,7 @@ public function testResultEmpty() {
$output
=
\Drupal
::
service
(
'renderer'
)
->
renderRoot
(
$output
);
$this
->
setRawContent
(
$output
);
$this
->
assertText
(
'start: 0 | end: 0 | total: 0 | label: test_area_result | per page: 0 | current page: 1 | current record count: 0 | page count: 1'
);
$this
->
assertRaw
(
'<header>'
);
// Test that the area is not displayed if we have not checked the empty
// checkbox.
...
...
@@ -67,6 +68,8 @@ public function testResultEmpty() {
$output
=
\Drupal
::
service
(
'renderer'
)
->
renderRoot
(
$output
);
$this
->
setRawContent
(
$output
);
$this
->
assertNoText
(
'start: 0 | end: 0 | total: 0 | label: test_area_result | per page: 0 | current page: 1 | current record count: 0 | page count: 1'
);
// Make sure the empty header region isn't rendered.
$this
->
assertNoRaw
(
'<header>'
);
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment