Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
facets
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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
facets
Merge requests
!81
Update src/Plugin/Block/FacetBlock.php
Code
Review changes
Check out branch
Download
Patches
Plain diff
Open
Update src/Plugin/Block/FacetBlock.php
issue/facets-3298956:3298956-empty-dependent-facet
into
2.0.x
Overview
0
Commits
1
Pipelines
0
Changes
1
Open
IMMACULATE X
requested to merge
issue/facets-3298956:3298956-empty-dependent-facet
into
2.0.x
2 years ago
Overview
0
Commits
1
Pipelines
0
Changes
1
Expand
Closes
#3298956
0
0
Merge request reports
Compare
2.0.x
2.0.x (HEAD)
and
latest version
latest version
e4187653
1 commit,
2 years ago
1 file
+
5
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
src/Plugin/Block/FacetBlock.php
+
5
−
0
Options
@@ -89,6 +89,11 @@ class FacetBlock extends BlockBase implements ContainerFactoryPluginInterface {
// Let the facet_manager build the facets.
$build
=
$this
->
facetManager
->
build
(
$facet
);
if
(
$this
->
inPreview
&&
in_array
(
'facet-hidden'
,
$build
[
0
][
"#attributes"
][
"class"
]))
{
// Layout Builder UI will not show facet block with 'facet-hidden'
// attribute unless we return empty array here.
return
[];
}
if
(
!
empty
(
$build
))
{
CacheableMetadata
::
createFromObject
(
$this
)
->
applyTo
(
$build
);
Loading