Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
entity_browser_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
entity_browser_block
Merge requests
!10
Issue
#3314957
by dave reid: Add dependencies on selected entities, view modes, and entity browser
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Issue
#3314957
by dave reid: Add dependencies on selected entities, view modes, and entity browser
issue/entity_browser_block-3314957:3314957-2.x
into
2.0.x
Overview
0
Commits
1
Pipelines
1
Changes
1
Merged
Stephen Mustgrave
requested to merge
issue/entity_browser_block-3314957:3314957-2.x
into
2.0.x
5 months ago
Overview
0
Commits
1
Pipelines
1
Changes
1
Expand
Closes
#3314957
0
0
Merge request reports
Compare
2.0.x
2.0.x (base)
and
latest version
latest version
76e3dfdf
1 commit,
5 months ago
1 file
+
17
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
src/Plugin/Block/EntityBrowserBlock.php
+
17
−
0
Options
@@ -312,4 +312,21 @@ class EntityBrowserBlock extends BlockBase implements ContainerFactoryPluginInte
return
$build
;
}
/**
* {@inheritdoc}
*/
public
function
calculateDependencies
():
array
{
$dependencies
=
parent
::
calculateDependencies
();
if
(
$entities
=
static
::
loadEntitiesByIDs
(
$this
->
configuration
[
'entity_ids'
]))
{
foreach
(
$entities
as
$id
=>
$entity
)
{
$dependencies
[
$entity
->
getConfigDependencyKey
()][]
=
$entity
->
getConfigDependencyName
();
$view_mode
=
$this
->
configuration
[
'view_modes'
][
$id
];
$dependencies
[
'config'
][]
=
'core.entity_view_display.'
.
$entity
->
getEntityTypeId
()
.
'.'
.
$entity
->
bundle
()
.
$view_mode
;
}
}
// This block is dependent on the entity browser itself.
$dependencies
[
'config'
][]
=
'entity_browser.browser.'
.
$this
->
getDerivativeId
();
return
$dependencies
;
}
}
Loading