Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
entity_holder
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_holder
Commits
18cc119d
Commit
18cc119d
authored
10 months ago
by
Manuel Adán
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3439042
by manuel.adan: Cannot create holders for content entities without bundles
parent
306a3966
No related branches found
No related tags found
1 merge request
!8
Prevent exception if no bundle set when holding entity.
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Entity/EntityHolder.php
+2
-1
2 additions, 1 deletion
src/Entity/EntityHolder.php
with
2 additions
and
1 deletion
src/Entity/EntityHolder.php
+
2
−
1
View file @
18cc119d
...
...
@@ -161,7 +161,8 @@ class EntityHolder extends ConfigEntityBase implements EntityHolderInterface {
throw
new
\InvalidArgumentException
(
'Entity type mismatch.'
);
}
if
(
$this
->
getHeldEntityBundle
()
!=
$entity
->
bundle
())
{
$expected_bundle
=
$this
->
getHeldEntityBundle
();
if
(
!
empty
(
$expected_bundle
)
&&
$expected_bundle
!=
$entity
->
bundle
())
{
throw
new
\InvalidArgumentException
(
'Entity bundle mismatch.'
);
}
...
...
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