Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
ea24dc51
Commit
ea24dc51
authored
Nov 22, 2014
by
alexpott
Browse files
Issue
#2374339
by benjy, chx: FieldConfigBase::calculateDependencies() fatal error is unhelpful
parent
21765ac4
Changes
1
Hide whitespace changes
Inline
Side-by-side
core/lib/Drupal/Core/Field/FieldConfigBase.php
View file @
ea24dc51
...
...
@@ -13,6 +13,7 @@
use
Drupal\Core\Entity\EntityStorageInterface
;
use
Drupal\Core\Entity\FieldableEntityInterface
;
use
Drupal\Core\Field\TypedData\FieldItemDataDefinition
;
use
Drupal\Component\Utility\String
;
/**
* Base class for configurable field definitions.
...
...
@@ -248,7 +249,9 @@ public function calculateDependencies() {
// depend on the bundle entity.
$bundle_entity_type_id
=
$this
->
entityManager
()
->
getDefinition
(
$this
->
entity_type
)
->
getBundleEntityType
();
if
(
$bundle_entity_type_id
!=
'bundle'
)
{
$bundle_entity
=
$this
->
entityManager
()
->
getStorage
(
$bundle_entity_type_id
)
->
load
(
$this
->
bundle
);
if
(
!
$bundle_entity
=
$this
->
entityManager
()
->
getStorage
(
$bundle_entity_type_id
)
->
load
(
$this
->
bundle
))
{
throw
new
\
LogicException
(
String
::
format
(
'Missing bundle entity, entity type %type, entity id %bundle.'
,
array
(
'%type'
=>
$bundle_entity_type_id
,
'%id'
=>
$this
->
bundle
)));
}
$this
->
addDependency
(
'config'
,
$bundle_entity
->
getConfigDependencyName
());
}
return
$this
->
dependencies
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment