Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
uw_custom_blocks
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
WCMS
uw_custom_blocks
Commits
f2aea8bf
Commit
f2aea8bf
authored
8 months ago
by
Eric Bremner
Committed by
Kevin Paxman
8 months ago
Browse files
Options
Downloads
Patches
Plain Diff
ISTWCMS-6944: Fix the label for catalogs when there are no catalogs
parent
ac5fd5a0
No related branches found
No related tags found
1 merge request
!240
ISTWCMS-6944: add code for search label to services search block
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/Plugin/Block/UwCblCatalogSearch.php
+1
-1
1 addition, 1 deletion
src/Plugin/Block/UwCblCatalogSearch.php
uw_custom_blocks.module
+19
-2
19 additions, 2 deletions
uw_custom_blocks.module
with
20 additions
and
3 deletions
src/Plugin/Block/UwCblCatalogSearch.php
+
1
−
1
View file @
f2aea8bf
...
...
@@ -133,7 +133,7 @@ class UwCblCatalogSearch extends BlockBase implements ContainerFactoryPluginInte
// If there is no block title, then set the label so that
// the template will know to place a visually hidden one.
if
(
!
$this
->
configuration
[
'label_display'
])
{
if
(
!
$this
->
configuration
[
'label_display'
]
&&
$catalog_available_flag
)
{
$catalog_search
[
'label'
]
=
$this
->
t
(
'Catalog search'
);
}
...
...
This diff is collapsed.
Click to expand it.
uw_custom_blocks.module
+
19
−
2
View file @
f2aea8bf
...
...
@@ -639,8 +639,25 @@ function uw_custom_blocks_preprocess_block(&$variables) {
// If this is a search block add the label stuff to the variables.
if
(
in_array
(
$variables
[
'plugin_id'
],
$search_blocks
))
{
$variables
[
'add_label_flag'
]
=
TRUE
;
$variables
[
'label_for'
]
=
'edit-search-input-'
.
$variables
[
'configuration'
][
'uuid'
];
// If this is a catalog, then ensure there are terms.
if
(
isset
(
$variables
[
'configuration'
][
'catalog'
]))
{
// Load the taxonomy term.
$term
=
\Drupal
::
service
(
'entity_type.manager'
)
->
getStorage
(
'taxonomy_term'
)
->
load
(
$variables
[
'configuration'
][
'catalog'
]);
// If the term is null, set the flag.
if
(
$term
)
{
$variables
[
'add_label_flag'
]
=
TRUE
;
$variables
[
'label_for'
]
=
'edit-search-input-'
.
$variables
[
'configuration'
][
'uuid'
];
}
}
else
{
$variables
[
'add_label_flag'
]
=
TRUE
;
$variables
[
'label_for'
]
=
'edit-search-input-'
.
$variables
[
'configuration'
][
'uuid'
];
}
}
}
...
...
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