sitemap.xml generates a link to sitemap-singles.xml which generates an error:
BarrelStrength\Sprout\sitemaps\sitemaps\XmlSitemap::getDynamicSitemapElements(): Argument #3 ($pageNumber) must be of type int, null given, called in /var/www/html/vendor/barrelstrength/sprout/src/sitemaps/controllers/XmlSitemapController.php on line 71
in /var/www/html/vendor/barrelstrength/sprout/src/sitemaps/sitemaps/XmlSitemap.phpat line 43
in /var/www/html/vendor/barrelstrength/sprout/src/sitemaps/controllers/XmlSitemapController.php at line 71– BarrelStrength\Sprout\sitemaps\sitemaps\XmlSitemap::getDynamicSitemapElements('singles', 'singles', null, [1 => craft\models\Site], ...)
in /var/www/html/vendor/yiisoft/yii2/base/InlineAction.php at line 57– call_user_func_array([BarrelStrength\Sprout\sitemaps\controllers\XmlSitemapController, 'actionRenderXmlSitemap'], ['singles', null])
in /var/www/html/vendor/yiisoft/yii2/web/Application.php at line 103– craft\web\Application::runAction('sprout-module-sitemaps/xml-sitem...', ['sitemapMetadataUid' => 'singles'])
go to /sitemap-singles.xml
error will be displayed
i was able to stop the error by editing vendor/barrelstrength/sprout/src/sitemaps/controllers/XmlSitemapController.php
changing line 26 from:
public function actionRenderXmlSitemap(string $sitemapMetadataUid = null, int $pageNumber = null): Response
to
public function actionRenderXmlSitemap(string $sitemapMetadataUid = null, int $pageNumber = 0): Response
Description
sitemap.xml generates a link to sitemap-singles.xml which generates an error: BarrelStrength\Sprout\sitemaps\sitemaps\XmlSitemap::getDynamicSitemapElements(): Argument #3 ($pageNumber) must be of type int, null given, called in /var/www/html/vendor/barrelstrength/sprout/src/sitemaps/controllers/XmlSitemapController.php on line 71
How to reproduce
go to /sitemap-singles.xml error will be displayed
i was able to stop the error by editing vendor/barrelstrength/sprout/src/sitemaps/controllers/XmlSitemapController.php changing line 26 from: public function actionRenderXmlSitemap(string $sitemapMetadataUid = null, int $pageNumber = null): Response
to public function actionRenderXmlSitemap(string $sitemapMetadataUid = null, int $pageNumber = 0): Response
Sprout Version
4.44.444-beta.2
Craft Version
Craft Pro 4.8.9
Database Type Version
MariaDB 10.4.33