X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Flib%2FDrupal%2FCore%2FEntity%2FEntityStorageBase.php;fp=web%2Fcore%2Flib%2FDrupal%2FCore%2FEntity%2FEntityStorageBase.php;h=e5bf880aef2a89ffd259649cdfb08e8fcc756608;hp=99698df0ae21986df51086fe88cc960dc9797c6f;hb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;hpb=aea91e65e895364e460983b890e295aa5d5540a5 diff --git a/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php b/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php index 99698df0a..e5bf880ae 100644 --- a/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php +++ b/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php @@ -499,11 +499,22 @@ abstract class EntityStorageBase extends EntityHandlerBase implements EntityStor public function loadByProperties(array $values = []) { // Build a query to fetch the entity IDs. $entity_query = $this->getQuery(); + $entity_query->accessCheck(FALSE); $this->buildPropertyQuery($entity_query, $values); $result = $entity_query->execute(); return $result ? $this->loadMultiple($result) : []; } + /** + * {@inheritdoc} + */ + public function hasData() { + return (bool) $this->getQuery() + ->accessCheck(FALSE) + ->range(0, 1) + ->execute(); + } + /** * {@inheritdoc} */