Commit 8c607004 authored by git's avatar git Committed by RenatoG

Issue #2545050 by jaylensoeur, Dave Reid, Chris2, RenatoG: Dont write empty...

Issue #2545050 by jaylensoeur, Dave Reid, Chris2, RenatoG: Dont write empty element in xml sitemap file
parent 129a2102
......@@ -259,7 +259,9 @@ function xmlsitemap_generate_chunk(stdClass $sitemap, XMLSitemapWriter $writer,
// @todo Should this be moved to XMLSitemapWritier::writeSitemapElement()?
drupal_alter('xmlsitemap_element', $element, $link, $sitemap);
$writer->writeSitemapElement('url', $element);
if (!empty($element)) {
$writer->writeSitemapElement('url', $element);
}
}
return $link_count;
......
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