X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fmodules%2Fcontrib%2Fpathauto%2Fsrc%2FPlugin%2Fpathauto%2FAliasType%2FEntityAliasTypeBase.php;fp=web%2Fmodules%2Fcontrib%2Fpathauto%2Fsrc%2FPlugin%2Fpathauto%2FAliasType%2FEntityAliasTypeBase.php;h=c612a2b6db6fea395d35551fc6ff9999e7ca56f5;hp=121f04b385bf8cc1989f8009e2eb6fa0b9361021;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0 diff --git a/web/modules/contrib/pathauto/src/Plugin/pathauto/AliasType/EntityAliasTypeBase.php b/web/modules/contrib/pathauto/src/Plugin/pathauto/AliasType/EntityAliasTypeBase.php index 121f04b38..c612a2b6d 100644 --- a/web/modules/contrib/pathauto/src/Plugin/pathauto/AliasType/EntityAliasTypeBase.php +++ b/web/modules/contrib/pathauto/src/Plugin/pathauto/AliasType/EntityAliasTypeBase.php @@ -226,7 +226,7 @@ class EntityAliasTypeBase extends ContextAwarePluginBase implements AliasTypeInt $query->range(0, 100); $pids_by_id = $query->execute()->fetchAllKeyed(); - $this->bulkDelete($pids_by_id); + PathautoState::bulkDelete($this->getEntityTypeId(), $pids_by_id); $context['sandbox']['count'] += count($pids_by_id); $context['sandbox']['current'] = max($pids_by_id); $context['results']['deletions'][] = $this->getLabel(); @@ -285,19 +285,11 @@ class EntityAliasTypeBase extends ContextAwarePluginBase implements AliasTypeInt * * @param int[] $pids_by_id * A list of path IDs keyed by entity ID. + * + * @deprecated Use \Drupal\pathauto\PathautoState::bulkDelete() instead. */ protected function bulkDelete(array $pids_by_id) { - $collection = 'pathauto_state.' . $this->getEntityTypeId(); - $states = $this->keyValue->get($collection)->getMultiple(array_keys($pids_by_id)); - - $pids = []; - foreach ($pids_by_id as $id => $pid) { - // Only delete aliases that were created by this module. - if (isset($states[$id]) && $states[$id] == PathautoState::CREATE) { - $pids[] = $pid; - } - } - \Drupal::service('pathauto.alias_storage_helper')->deleteMultiple($pids); + PathautoState::bulkDelete($this->getEntityTypeId(), $pids_by_id); } /**