Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Live preview not working with disabled site #646

Closed
WHITE-developer opened this issue Mar 25, 2024 · 1 comment
Closed

Live preview not working with disabled site #646

WHITE-developer opened this issue Mar 25, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@WHITE-developer
Copy link

Bug Report

When you have a site globally disabled in the settings -> sites, the preview function breaks when using includeDynamic or includeCached in the template. setCurrentSite tries getSiteById which has the withDisabled parameter false.

yii\base\InvalidArgumentException: Invalid site: 16 in /var/www/html/vendor/craftcms/cms/src/services/Sites.php:490
Stack trace:
#0 /var/www/html/vendor/putyourlightson/craft-blitz/src/controllers/IncludeController.php(60): craft\services\Sites->setCurrentSite(16)
#1 /var/www/html/vendor/putyourlightson/craft-blitz/src/controllers/IncludeController.php(31): putyourlightson\blitz\controllers\IncludeController->getRenderedTemplate()
#2 [internal function]: putyourlightson\blitz\controllers\IncludeController->actionCached()
#3 /var/www/html/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#4 /var/www/html/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams(Array)
#5 /var/www/html/vendor/yiisoft/yii2/base/Module.php(552): yii\base\Controller->runAction('cached', Array)
#6 /var/www/html/vendor/craftcms/cms/src/web/Application.php(341): yii\base\Module->runAction('blitz/include/c...', Array)
#7 /var/www/html/vendor/craftcms/cms/src/web/Application.php(642): craft\web\Application->runAction('blitz/include/c...', Array)
#8 /var/www/html/vendor/craftcms/cms/src/web/Application.php(303): craft\web\Application->_processActionRequest(Object(craft\web\Request))
#9 /var/www/html/vendor/yiisoft/yii2/base/Application.php(384): craft\web\Application->handleRequest(Object(craft\web\Request))
#10 /var/www/html/web/index.php(12): yii\base\Application->run()
#11 {main}

Plugin Version

4.14.0

Craft CMS Version

4.8.5

PHP Version

8.2.13

@WHITE-developer WHITE-developer added the bug Something isn't working label Mar 25, 2024
@bencroker
Copy link
Collaborator

Thanks for reporting this! Fixed in 7be55f7 and released in 4.14.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants