I downloaded and installed the latest module (8.x-1.2) and ran cron to generate the sitemap.xml.

When cron finished running, I got an error:

Warning: Invalid argument supplied for foreach() in Drupal\simplesitemap\SitemapGenerator->generate_entity_links() (line 76 of modules/contrib/simple_sitemap/src/SitemapGenerator.php). 

When I view the sitemap, I get the following:

<urlset>
  <url>
    <loc>http://localhost/</loc>
    <priority>1</priority>
  </url>
</urlset>

This only happens if no content types are selected to be added to the XML sitemap.

Maybe there should be a message stating to add at least one content type to the XML sitemap.

Thanks!

Comments

sagesolutions created an issue. See original summary.

sagesolutions’s picture

Issue summary: View changes

  • gbyte.co committed 4fbfba0 on 8.x-1.x
    Issue #2623932 by sagesolutions: Fixed error message during cron when no...
gbyte’s picture

Status: Active » Closed (fixed)

Hi sagesolutions,

fixed in the dev version.

Thanks for reporting.