Commit 272c2410 authored by andrei.dincu's avatar andrei.dincu

Issue #2249723 by andrei.dincu: Few changes in xmlsitemap_sitemap_load_by_context()

parent 7b9f643e
......@@ -416,11 +416,9 @@ function xmlsitemap_sitemap_load_by_context(array $context = NULL) {
if (!isset($context)) {
$context = xmlsitemap_get_current_context();
}
$hash = xmlsitemap_sitemap_get_context_hash($context);
$sitemaps = \Drupal::entityManager()->getStorage('xmlsitemap')->loadMultiple();
return reset($sitemaps);
foreach ($sitemaps as $sitemap) {
if ($sitemap->getContext() == $hash) {
if ($sitemap->context == $context) {
return $sitemap;
}
}
......
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