diff --git a/core/lib/Drupal/Core/Entity/ContentUninstallValidator.php b/core/lib/Drupal/Core/Entity/ContentUninstallValidator.php index 9cd3f7a..6b90843 100644 --- a/core/lib/Drupal/Core/Entity/ContentUninstallValidator.php +++ b/core/lib/Drupal/Core/Entity/ContentUninstallValidator.php @@ -41,10 +41,10 @@ public function validate($module) { $reasons = []; foreach ($entity_types as $entity_type) { if ($module == $entity_type->getProvider() && $entity_type instanceof ContentEntityTypeInterface && $this->entityManager->getStorage($entity_type->id())->hasData()) { - $reasons[] = $this->t('There is content for the entity type: @entity_type. Remove @entity_type_plural.', [ + $reasons[] = $this->t('There is content for the entity type: @entity_type. Remove @entity_type_plural.', [ '@entity_type' => $entity_type->getLabel(), '@entity_type_plural' => $entity_type->getPluralLabel(), - ':link' => Url::fromRoute('system.prepare_modules_entity_uninstall', ['entity_type_id' => $entity_type->id()])->toString(), + ':url' => Url::fromRoute('system.prepare_modules_entity_uninstall', ['entity_type_id' => $entity_type->id()])->toString(), ]); } } diff --git a/core/modules/system/src/Form/PrepareModulesEntityUninstallForm.php b/core/modules/system/src/Form/PrepareModulesEntityUninstallForm.php index ed17c8c..0601bc4 100644 --- a/core/modules/system/src/Form/PrepareModulesEntityUninstallForm.php +++ b/core/modules/system/src/Form/PrepareModulesEntityUninstallForm.php @@ -194,12 +194,16 @@ public static function deleteContentEntities($entity_type_id, $limit, &$context) if (!isset($context['sandbox']['progress'])) { $context['sandbox']['progress'] = 0; - $context['sandbox']['max'] = \Drupal::entityQuery($entity_type_id)->count()->execute(); + $context['sandbox']['max'] = $storage->getQuery()->count()->execute(); } - $entity_ids = $storage->getQuery()->range(0, $limit)->execute(); - if ($entity_types = $storage->loadMultiple($entity_ids)) { - $storage->delete($entity_types); + $entity_type = \Drupal::entityTypeManager()->getDefinition($entity_type_id); + $entity_ids = $storage->getQuery() + ->sort($entity_type->getKey('id'), 'ASC') + ->range(0, $limit) + ->execute(); + if ($entities = $storage->loadMultiple($entity_ids)) { + $storage->delete($entities); } $context['sandbox']['progress'] += count($entity_ids);