Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
xmlsitemap
Commits
80814fb9
Unverified
Commit
80814fb9
authored
Sep 26, 2018
by
Dave Reid
Committed by
Dave Reid
Sep 26, 2018
Browse files
Follow-up
#2387341
by Dave Reid: Fixed duplicated code left in xmlsitemap_entity_update().
parent
736d0e02
Changes
1
Hide whitespace changes
Inline
Side-by-side
xmlsitemap.module
View file @
80814fb9
...
...
@@ -1690,30 +1690,6 @@ function xmlsitemap_entity_insert(EntityInterface $entity) {
function
xmlsitemap_entity_update
(
EntityInterface
$entity
)
{
if
(
xmlsitemap_link_bundle_check_enabled
(
$entity
->
getEntityTypeId
(),
$entity
->
bundle
()))
{
xmlsitemap_xmlsitemap_process_entity_link
(
$entity
);
// Check if we have differences between the translations from the link
// storage and the current translations of the entity, and if so, remove
// them.
if
(
$entity
instanceof
ContentEntityInterface
)
{
$translation_languages
=
$entity
->
getTranslationLanguages
();
$link_storage
=
\
Drupal
::
service
(
'xmlsitemap.link_storage'
);
$link_storage_languages
=
[];
$links
=
$link_storage
->
loadMultiple
([
'type'
=>
$entity
->
getEntityTypeId
(),
'id'
=>
$entity
->
id
(),
]);
foreach
(
$links
as
$link
)
{
$link_storage_languages
[]
=
$link
[
'language'
];
}
if
(
$language_differences
=
array_diff
(
$link_storage_languages
,
array_keys
(
$translation_languages
)))
{
$link_storage
->
deleteMultiple
([
'type'
=>
$entity
->
getEntityTypeId
(),
'id'
=>
$entity
->
id
(),
'language'
=>
$language_differences
,
]);
}
}
}
}
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment