Commit 180da359 authored by andrei.dincu's avatar andrei.dincu

Issue #2249723 by andrei.dincu: Few updates in xmlsitemap.module file

parent 99df2a5d
......@@ -371,9 +371,13 @@ function xmlsitemap_sitemap_load_multiple($smids = array(), array $conditions =
}
$sitemaps = $query->execute()->fetchAllAssoc('smid');
*/
foreach ($sitemaps as $sitemap) {
$sitemaps[$sitemap->id()]->setContext(unserialize($sitemap->getContext()));
$sitemaps[$sitemap->id()]->uri = xmlsitemap_sitemap_uri($sitemap);
if (count($sitemaps) <= 0) {
return array();
}
foreach ($sitemaps as &$sitemap) {
$sitemap->setContext(unserialize($sitemap->getContext()));
$uri = xmlsitemap_sitemap_uri($sitemap);
$sitemap->uri = $uri;
}
return $sitemaps;
......@@ -516,7 +520,8 @@ function xmlsitemap_sitemap_get_context_hash(array &$context) {
function xmlsitemap_sitemap_uri(XmlSitemapInterface $sitemap) {
$uri['path'] = 'sitemap.xml';
$uri['options'] = module_invoke_all('xmlsitemap_context_url_options', $sitemap->getContext());
drupal_alter('xmlsitemap_context_url_options', $uri['options'], $sitemap->getContext());
$context = $sitemap->getContext();
\Drupal::moduleHandler()->alter('xmlsitemap_context_url_options', $uri['options'], $context);
$uri['options'] += array(
'absolute' => TRUE,
'base_url' => \Drupal::state()->get('base_url')
......
......@@ -151,7 +151,6 @@ function xmlsitemap_engines_submit_sitemaps($url, array $sitemaps) {
watchdog('xmlsitemap', 'Submitted the sitemap to %url and received response @code.', array('%url' => $submit_url, '@code' => $request->getStatusCode()));
}
catch (RequestException $ex) {
print "ana are mere" . PHP_EOL;
watchdog_exception('xmlsitemap', 'Submitted the sitemap to %url failed with response @code.',array('%url' => $submit_url,'@code' => $request->getStatusCode()));
}
}
......
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