Dolphiq / craft3-plugin-sitemap

A craft 3 plugin that provides an easy way to enable and manage an XML sitemap for search engines like Google
MIT License
28 stars 18 forks source link

No output with multi-language sites #25

Open 99ster opened 5 years ago

99ster commented 5 years ago

The XML file is just blank on multi-language sites... :(

mrnebbi commented 4 years ago

I'm also having this problem, and am wondering if it's related to the deletion of site from the sites list. We had 5 languages for our site, but dropped the second one.

Exception (Exception) 'yii\base\Exception' with message 'Invalid site ID: 2' 

in /PATH/vendor/craftcms/cms/src/helpers/UrlHelper.php:314

Stack trace:
#0 /PATH/vendor/dolphiq/sitemap/src/controllers/SitemapController.php(189): craft\helpers\UrlHelper::siteUrl('page-ur...', NULL, NULL, 2)
#1 /PATH/vendor/dolphiq/sitemap/src/controllers/SitemapController.php(106): dolphiq\sitemap\controllers\SitemapController->getUrl('page-ur...', '2')
#2 [internal function]: dolphiq\sitemap\controllers\SitemapController->actionIndex()
#3 /PATH/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#4 /PATH/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#5 /PATH/vendor/craftcms/cms/src/web/Controller.php(187): yii\base\Controller->runAction('index', Array)
#6 /PATH/vendor/yiisoft/yii2/base/Module.php(528): craft\web\Controller->runAction('index', Array)
#7 /PATH/vendor/craftcms/cms/src/web/Application.php(299): yii\base\Module->runAction('sitemap/sitemap...', Array)
#8 /PATH/vendor/yiisoft/yii2/web/Application.php(103): craft\web\Application->runAction('sitemap/sitemap...', Array)
#9 /PATH/vendor/craftcms/cms/src/web/Application.php(284): yii\web\Application->handleRequest(Object(craft\web\Request))
#10 /PATH/vendor/yiisoft/yii2/base/Application.php(386): craft\web\Application->handleRequest(Object(craft\web\Request))
#11 /PATH/web/index.php(21): yii\base\Application->run()
#12 {main}
mrnebbi commented 4 years ago

I can confirm my issue is caused by a deleted site. Changing the dateDeleted column in the the craft_sites table fixes the issue. Reinstating the dateDeleted causes the problem to reappear.