Skip to content
Snippets Groups Projects

Add bundle to media query and better value check.

2 files
+ 13
5
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 12
4
@@ -282,10 +282,18 @@ class EntityTypeInfo {
$entity_count = 0;
if ($field_storage->getType() === 'entity_reference') {
$entity_storage = $this->entityTypeManager->getStorage($entity_type);
$query = $entity_storage->getQuery()
->condition('type', $bundle)
->exists($field_name)
->accessCheck(TRUE);
if ($entity_type == 'media') {
$query = $entity_storage->getQuery()
->condition('bundle', $bundle)
->exists($field_name)
->accessCheck(TRUE);
}
else {
$query = $entity_storage->getQuery()
->condition('type', $bundle)
->exists($field_name)
->accessCheck(TRUE);
}
$entity_count = $query->count()->execute();
// Add the information to the summary.
Loading