Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
quicktabs
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
quicktabs
Commits
fb696fea
Commit
fb696fea
authored
Dec 15, 2020
by
Brooke Heaton
Committed by
Shelane French
Dec 15, 2020
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#2909326
by brooke_heaton: Empty Views Tabs still being rendered
parent
42fc5fdb
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Plugin/TabType/ViewContent.php
+27
-1
27 additions, 1 deletion
src/Plugin/TabType/ViewContent.php
with
27 additions
and
1 deletion
src/Plugin/TabType/ViewContent.php
+
27
−
1
View file @
fb696fea
...
...
@@ -103,7 +103,33 @@ class ViewContent extends TabTypeBase {
return
[];
}
// Return empty if the view is empty.
$view_results
=
views_get_view_result
(
$options
[
'vid'
],
$options
[
'display'
]);
if
(
!
$view_results
&&
!
empty
(
$options
[
'vid'
])
&&
!
empty
(
$options
[
'display'
]))
{
// if the initial view is empty, check the attachments
$view
=
Views
::
getView
(
$options
[
'vid'
]);
$view
->
setDisplay
(
$options
[
'display'
]);
$display
=
$view
->
getDisplay
();
$attachments
=
$display
->
getAttachedDisplays
();
// If there are attachments, check if they are empty.
if
(
!
empty
(
$attachments
))
{
foreach
(
$attachments
as
$attachment
)
{
if
(
!
empty
(
views_get_view_result
(
$options
[
'vid'
],
$attachment
)))
{
$view_results
=
TRUE
;
continue
;
}
}
}
}
if
(
empty
(
$view_results
))
{
return
[];
}
else
{
$render
=
$view
->
buildRenderable
(
$options
[
'display'
],
$args
);
}
// Set additional cache keys that depend on the arguments provided for this
// view.
...
...
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