Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
entity_reference_revisions
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_reference_revisions
Merge requests
!64
Only create a new revision when necessary
Code
Review changes
Check out branch
Download
Patches
Plain diff
Open
Only create a new revision when necessary
issue/entity_reference_revisions-3493179:3493179-do-not-create
into
8.x-1.x
Overview
0
Commits
27
Pipelines
15
Changes
1
Open
Alex Pott
requested to merge
issue/entity_reference_revisions-3493179:3493179-do-not-create
into
8.x-1.x
5 months ago
Overview
0
Commits
27
Pipelines
15
Changes
1
Expand
Closes
#3493179
0
0
Merge request reports
Compare
8.x-1.x
version 14
36056dad
3 months ago
version 13
8d1cb318
3 months ago
version 12
f425735e
3 months ago
version 11
950d4e67
3 months ago
version 10
2d589c74
3 months ago
version 9
4704674a
3 months ago
version 8
c03fabd9
3 months ago
version 7
f44e25d4
3 months ago
version 6
b36221d3
3 months ago
version 5
c92f7fc0
3 months ago
version 4
23991c9f
3 months ago
version 3
3654ba39
3 months ago
version 2
2e20d629
5 months ago
version 1
c4f2dbca
5 months ago
8.x-1.x (HEAD)
and
latest version
latest version
671cb26b
27 commits,
3 months ago
version 14
36056dad
15 commits,
3 months ago
version 13
8d1cb318
14 commits,
3 months ago
version 12
f425735e
13 commits,
3 months ago
version 11
950d4e67
12 commits,
3 months ago
version 10
2d589c74
11 commits,
3 months ago
version 9
4704674a
10 commits,
3 months ago
version 8
c03fabd9
9 commits,
3 months ago
version 7
f44e25d4
8 commits,
3 months ago
version 6
b36221d3
7 commits,
3 months ago
version 5
c92f7fc0
5 commits,
3 months ago
version 4
23991c9f
4 commits,
3 months ago
version 3
3654ba39
3 commits,
3 months ago
version 2
2e20d629
2 commits,
5 months ago
version 1
c4f2dbca
1 commit,
5 months ago
1 file
+
13
−
2
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
src/Plugin/Field/FieldType/EntityReferenceRevisionsItem.php
+
13
−
2
Options
@@ -279,8 +279,19 @@ class EntityReferenceRevisionsItem extends EntityReferenceItem implements Option
$is_affected
=
!
$this
->
getFieldDefinition
()
->
isTranslatable
()
||
(
$host
instanceof
TranslatableRevisionableInterface
&&
$host
->
hasTranslationChanges
());
if
(
$is_affected
&&
!
$host
->
isNew
()
&&
$this
->
entity
&&
$this
->
entity
->
getEntityType
()
->
get
(
'entity_revision_parent_id_field'
))
{
if
(
$host
->
isNewRevision
())
{
$this
->
entity
->
setNewRevision
();
$needs_save
=
TRUE
;
$has_newer_revision
=
FALSE
;
if
(
!
empty
(
$host
->
original
))
{
$old_revision_id
=
$host
->
original
->
get
(
$this
->
getFieldDefinition
()
->
getName
())
->
get
(
$this
->
getName
())
->
target_revision_id
;
if
(
$old_revision_id
<
$this
->
target_revision_id
)
{
// If the item is pointing to a newer revision we should not
// be creating one.
$has_newer_revision
=
TRUE
;
}
}
if
(
!
$has_newer_revision
)
{
$this
->
entity
->
setNewRevision
();
$needs_save
=
TRUE
;
}
}
// Additionally ensure that the default revision state is kept in sync.
if
(
$this
->
entity
&&
$host
->
isDefaultRevision
()
!=
$this
->
entity
->
isDefaultRevision
())
{
Loading