Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal-3313342
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-3313342
Commits
bd9e0b10
Commit
bd9e0b10
authored
2 years ago
by
Ilias Dimopoulos
Browse files
Options
Downloads
Patches
Plain Diff
Simplify the condition.
parent
429da59d
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/layout_builder/layout_builder.module
+1
-1
1 addition, 1 deletion
core/modules/layout_builder/layout_builder.module
core/modules/layout_builder/src/Cache/LayoutBuilderUiCacheContext.php
+4
-1
4 additions, 1 deletion
.../layout_builder/src/Cache/LayoutBuilderUiCacheContext.php
with
5 additions
and
2 deletions
core/modules/layout_builder/layout_builder.module
+
1
−
1
View file @
bd9e0b10
...
...
@@ -158,7 +158,7 @@ function layout_builder_entity_view_alter(array &$build, EntityInterface $entity
// If the entity is displayed within a Layout Builder block and the current
// route is in the Layout Builder UI, then remove all contextual link
// placeholders.
if
(
$display
instanceof
LayoutBuilderEntityViewDisplay
&&
strpos
(
strval
(
$route_name
)
,
'layout_builder.'
)
===
0
)
{
if
(
$display
instanceof
LayoutBuilderEntityViewDisplay
&&
!
empty
(
$route_name
)
&&
strpos
(
$route_name
,
'layout_builder.'
)
===
0
)
{
unset
(
$build
[
'#contextual_links'
]);
}
}
...
...
This diff is collapsed.
Click to expand it.
core/modules/layout_builder/src/Cache/LayoutBuilderUiCacheContext.php
+
4
−
1
View file @
bd9e0b10
...
...
@@ -25,7 +25,10 @@ public static function getLabel() {
* {@inheritdoc}
*/
public
function
getContext
()
{
return
'is_layout_builder_ui.'
.
(
int
)
(
strpos
(
strval
(
$this
->
routeMatch
->
getRouteName
()),
'layout_builder.'
)
!==
0
);
if
(
!
empty
(
$this
->
routeMatch
->
getRouteName
())
&&
strpos
(
$this
->
routeMatch
->
getRouteName
(),
'layout_builder.'
)
===
0
)
{
return
'is_layout_builder_ui.1'
;
}
return
'is_layout_builder_ui.0'
;
}
}
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