Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Issue forks
drupal-2974156
Commits
fdcf3021
Commit
fdcf3021
authored
Oct 14, 2021
by
jurgenhaas
Browse files
Add fix to the MR which currently only contains the test
parent
5706a723
Changes
1
Show whitespace changes
Inline
Side-by-side
core/modules/editor/editor.module
View file @
fdcf3021
...
...
@@ -396,14 +396,20 @@ function editor_entity_update(EntityInterface $entity) {
// File references that existed both in the previous version of the revision
// and in the new one don't need their usage to be updated.
else
{
$original_uuids_by_field
=
_editor_get_file_uuids_by_field
(
$entity
->
original
);
$original_uuids_by_field
=
empty
(
$entity
->
original
)
?
[]
:
_editor_get_file_uuids_by_field
(
$entity
->
original
);
$uuids_by_field
=
_editor_get_file_uuids_by_field
(
$entity
);
// Detect file usages that should be incremented.
foreach
(
$uuids_by_field
as
$field
=>
$uuids
)
{
$added_files
=
array_diff
(
$uuids_by_field
[
$field
],
$original_uuids_by_field
[
$field
]);
$original_uuids
=
isset
(
$original_uuids_by_field
[
$field
])
?
$original_uuids_by_field
[
$field
]
:
[];
if
(
$added_files
=
array_diff
(
$uuids_by_field
[
$field
],
$original_uuids
))
{
_editor_record_file_usage
(
$added_files
,
$entity
);
}
}
// Detect file usages that should be decremented.
foreach
(
$original_uuids_by_field
as
$field
=>
$uuids
)
{
...
...
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