Commit 704c976f authored by andrei.dincu's avatar andrei.dincu
Browse files

Issue #2249723 by andrei.dincu: Include in only content entity types in...

Issue #2249723 by andrei.dincu: Include in only content entity types in xmlsitemap entity form selection
parent a843dfec
...@@ -13,6 +13,7 @@ use Drupal\Core\Entity\EntityManagerInterface; ...@@ -13,6 +13,7 @@ use Drupal\Core\Entity\EntityManagerInterface;
use Drupal\Core\DependencyInjection\ContainerInjectionInterface; use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
use Drupal\Core\Language\LanguageInterface; use Drupal\Core\Language\LanguageInterface;
use Drupal\Core\Session\AnonymousUserSession; use Drupal\Core\Session\AnonymousUserSession;
use Drupal\Core\Entity\ContentEntityTypeInterface;
use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerInterface;
/** /**
...@@ -67,16 +68,7 @@ class XmlSitemapEntitiesSettingsForm extends ConfigFormBase implements Container ...@@ -67,16 +68,7 @@ class XmlSitemapEntitiesSettingsForm extends ConfigFormBase implements Container
$bundles = $this->entityManager->getAllBundleInfo(); $bundles = $this->entityManager->getAllBundleInfo();
foreach ($entity_types as $entity_type_id => $entity_type) { foreach ($entity_types as $entity_type_id => $entity_type) {
$access_controller = $this->entityManager->getAccessController($entity_type->id()); if (!$entity_type instanceof ContentEntityTypeInterface) {
if (!$access_controller) {
continue;
}
$entities = $this->entityManager->getStorage($entity_type_id)->loadMultiple();
if (!$entities) {
continue;
}
$entity = reset($entities);
if (!$access_controller->access($entity, 'view', LanguageInterface::LANGCODE_DEFAULT, $anonymous_user)) {
continue; continue;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment