Commit 7e427d5c authored by catch's avatar catch
Browse files

Issue #2391829 by amateescu, cilefen, Berdir, yched, fago:...

Issue #2391829 by amateescu, cilefen, Berdir, yched, fago: ContentUninstallValidator relies on the not required ContentEntityStorage::hasData() method
parent 32e40223
Loading
Loading
Loading
Loading
+7 −0
Changes for core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php: 7 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -316,6 +316,13 @@ protected function has($id, EntityInterface $entity) {
    return !$config->isNew();
  }

  /**
   * {@inheritdoc}
   */
  public function hasData() {
    return (bool) $this->configFactory->listAll($this->getPrefix());
  }

  /**
   * Gets entities from the static cache.
   *
+0 −10
Changes for core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php: 0 added lines, 10 removed lines.
Original line number Diff line number Diff line
@@ -62,16 +62,6 @@ public static function createInstance(ContainerInterface $container, EntityTypeI
    );
  }

  /**
   * {@inheritdoc}
   */
  public function hasData() {
    return (bool) $this->getQuery()
      ->accessCheck(FALSE)
      ->range(0, 1)
      ->execute();
  }

  /**
   * {@inheritdoc}
   */
+0 −8
Changes for core/lib/Drupal/Core/Entity/DynamicallyFieldableEntityStorageInterface.php: 0 added lines, 8 removed lines.
Original line number Diff line number Diff line
@@ -18,14 +18,6 @@
 */
interface DynamicallyFieldableEntityStorageInterface extends FieldableEntityStorageInterface, FieldStorageDefinitionListenerInterface, FieldDefinitionListenerInterface {

  /**
   * Determines if the storage contains any data.
   *
   * @return bool
   *   TRUE if the storage contains data, FALSE if not.
   */
  public function hasData();

  /**
   * Purges a batch of field data.
   *
+10 −0
Changes for core/lib/Drupal/Core/Entity/EntityStorageBase.php: 10 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -505,6 +505,16 @@ public function loadByProperties(array $values = []) {
    return $result ? $this->loadMultiple($result) : [];
  }

  /**
   * {@inheritdoc}
   */
  public function hasData() {
    return (bool) $this->getQuery()
      ->accessCheck(FALSE)
      ->range(0, 1)
      ->execute();
  }

  /**
   * {@inheritdoc}
   */
+8 −0
Changes for core/lib/Drupal/Core/Entity/EntityStorageInterface.php: 8 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -142,6 +142,14 @@ public function delete(array $entities);
   */
  public function save(EntityInterface $entity);

  /**
   * Determines if the storage contains any data.
   *
   * @return bool
   *   TRUE if the storage contains data, FALSE if not.
   */
  public function hasData();

  /**
   * Gets an entity query instance.
   *
Loading