Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
facets_block
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_block
Merge requests
!13
Refactored the facet block label code
Code
Review changes
Check out branch
Download
Patches
Plain diff
Open
Refactored the facet block label code
issue/facets_block-3450329:3450329-label-translations-are
into
2.0.x
Overview
0
Commits
1
Pipelines
1
Changes
1
Open
Yoram Derumeaux
requested to merge
issue/facets_block-3450329:3450329-label-translations-are
into
2.0.x
10 months ago
Overview
0
Commits
1
Pipelines
1
Changes
1
Expand
Issue
#3450329
: Refactored the code to fetch the correct block label.
0
0
Merge request reports
Compare
2.0.x
2.0.x (HEAD)
and
latest version
latest version
7c09809e
1 commit,
10 months ago
1 file
+
3
−
9
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
src/Plugin/Block/FacetsBlock.php
+
3
−
9
Options
@@ -256,15 +256,9 @@ class FacetsBlock extends BlockBase implements ContainerFactoryPluginInterface {
$build
[
'#attributes'
]
=
[];
}
if
(
isset
(
$build
[
'0'
][
'#facet'
])
&&
$build
[
'0'
][
'#facet'
]
instanceof
FacetInterface
)
{
$title
=
$build
[
'0'
][
'#facet'
]
->
getName
();
}
else
{
$title
=
$block_plugin
->
label
();
}
/** @var \Drupal\facets\Entity\Facet $facet */
$facet
=
$this
->
entityTypeManager
->
getStorage
(
'facets_facet'
)
->
load
(
$block_plugin
->
getDerivativeId
());
$title
=
(
$facet
instanceof
FacetInterface
)
?
$facet
->
getName
()
:
$block_plugin
->
label
();
// Inject unique class per facet.
$build
[
'#attributes'
][
'class'
][]
=
strtr
(
$plugin_id
,
'_:'
,
'--'
);
Loading