Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
layout_builder_st
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
layout_builder_st
Merge requests
!6
changes for getConfig method null
Code
Review changes
Check out branch
Download
Patches
Plain diff
Open
changes for getConfig method null
issue/layout_builder_st-3420063:3420063-error-call-to
into
8.x-1.x
Overview
0
Commits
3
Pipelines
0
Changes
1
Open
Mohd Sahzad
requested to merge
issue/layout_builder_st-3420063:3420063-error-call-to
into
8.x-1.x
1 year ago
Overview
0
Commits
3
Pipelines
0
Changes
1
Expand
Closes
#3420063
0
0
Merge request reports
Compare
8.x-1.x
version 2
efc43b35
1 year ago
version 1
c6085d9e
1 year ago
8.x-1.x (HEAD)
and
latest version
latest version
a00aa51b
3 commits,
1 year ago
version 2
efc43b35
2 commits,
1 year ago
version 1
c6085d9e
1 commit,
1 year ago
1 file
+
12
−
2
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
src/Plugin/SectionStorage/OverridesSectionStorage.php
+
12
−
2
Options
@@ -23,12 +23,22 @@ final class OverridesSectionStorage extends CoreOverridesSectionStorage implemen
*/
protected
function
handleTranslationAccess
(
AccessResult
$result
,
$operation
,
AccountInterface
$account
)
{
$entity
=
$this
->
getEntity
();
// Check if the entity is not null and allows overrides before accessing its properties.
if
(
!
$entity
||
!
$entity
->
hasField
(
static
::
FIELD_NAME
))
{
// Return a neutral result if the entity is null.
return
AccessResult
::
neutral
();
}
$field_config
=
$entity
->
getFieldDefinition
(
static
::
FIELD_NAME
)
->
getConfig
(
$entity
->
bundle
());
// Access is allow if one of the following conditions is true:
// Access is allowed if one of the following conditions is true:
// 1. This is the default translation.
// 2. The entity is translatable and the layout is overridden and the layout
// field is not translatable.
return
$result
->
andIf
(
AccessResult
::
allowedIf
(
$this
->
isDefaultTranslation
()
||
(
$entity
instanceof
TranslatableInterface
&&
$this
->
isOverridden
()
&&
!
$field_config
->
isTranslatable
())))
->
addCacheableDependency
(
$entity
)
->
addCacheableDependency
(
$field_config
);
return
$result
->
andIf
(
AccessResult
::
allowedIf
(
$this
->
isDefaultTranslation
()
||
(
$entity
instanceof
TranslatableInterface
&&
$this
->
isOverridden
()
&&
!
$field_config
->
isTranslatable
())))
->
addCacheableDependency
(
$entity
)
->
addCacheableDependency
(
$field_config
);
}
/**
Loading