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
Commits
a3bc8c25
Commit
a3bc8c25
authored
1 year ago
by
Bojan Bogdanovic
Committed by
Sascha Grossenbacher
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3272319
by pub497, bojan_dev: Error editing content with undefined language, add check
parent
80b50ed9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!18
Issue #3272319: Error editing content with undefined language, add check
Pipeline
#76553
canceled
1 year ago
Stage: build
Stage: validate
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
entity_reference_revisions.module
+5
-3
5 additions, 3 deletions
entity_reference_revisions.module
with
5 additions
and
3 deletions
entity_reference_revisions.module
+
5
−
3
View file @
a3bc8c25
...
...
@@ -293,10 +293,12 @@ function entity_reference_revisions_entity_revision_create(ContentEntityInterfac
/** @var \Drupal\Core\Entity\ContentEntityInterface $target_entity */
$target_entity
=
$item
->
entity
;
if
(
!
$target_entity
->
hasTranslation
(
$active_langcode
))
{
$target_entity
->
addTranslation
(
$active_langcode
,
$target_entity
->
toArray
());
if
(
$target_entity
->
isTranslatable
())
{
if
(
!
$target_entity
->
hasTranslation
(
$active_langcode
))
{
$target_entity
->
addTranslation
(
$active_langcode
,
$target_entity
->
toArray
());
}
$target_entity
=
$item
->
entity
->
getTranslation
(
$active_langcode
);
}
$target_entity
=
$item
->
entity
->
getTranslation
(
$active_langcode
);
$revised_entity
=
$target_storage
->
createRevision
(
$target_entity
,
$new_revision
->
isDefaultRevision
(),
$keep_untranslatable_fields
);
// Restore the revision ID.
...
...
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