Skip to content

Lite edition attempting to load site settings #350

@janklan

Description

@janklan

Description

When triggering any redirect, our Craft instance throws the following error:

yii\base\ErrorException: Uncaught PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'siteId' in 'where clause' in /var/www/html/vendor/yiisoft/yii2/db/Command.php:1320
Stack trace:
#0 /var/www/html/vendor/yiisoft/yii2/db/Command.php(1320): PDOStatement->execute()
#1 /var/www/html/vendor/yiisoft/yii2/db/Command.php(1186): yii\db\Command->internalExecute()
#2 /var/www/html/vendor/yiisoft/yii2/db/Command.php(443): yii\db\Command->queryInternal()
#3 /var/www/html/vendor/yiisoft/yii2/db/Query.php(304): yii\db\Command->queryScalar()
#4 /var/www/html/vendor/barrelstrength/sprout/src/redirects/RedirectsSettings.php(136): yii\db\Query->scalar()
#5 /var/www/html/vendor/barrelstrength/sprout/src/redirects/RedirectsSettings.php(147): BarrelStrength\Sprout\redirects\RedirectsSettings->getSiteExcludedUrlPatterns()
#6 /var/www/html/vendor/barrelstrength/sprout/src/redirects/redirects/Redirects.php(73): BarrelStrength\Sprout\redirects\RedirectsSettings->getExcludedUrlPatterns()
#7 /var/www/html/vendor/barrelstrength/sprout/src/redirects/redirects/Redirects.php(54): BarrelStrength\Sprout\redirects\redirects\Redirects->processRedirectsForCurrentRequest()
#8 /var/www/html/vendor/barrelstrength/sprout/src/redirects/RedirectsModule.php(162): BarrelStrength\Sprout\redirects\redirects\Redirects->handleRedirectsOnException()
#9 [internal function]: BarrelStrength\Sprout\redirects\RedirectsModule::BarrelStrength\Sprout\redirects\{closure}()
#10 /var/www/html/vendor/yiisoft/yii2/base/Event.php(312): call_user_func()
#11 /var/www/html/vendor/yiisoft/yii2/base/Component.php(654): yii\base\Event::trigger()
#12 /var/www/html/vendor/craftcms/cms/src/web/ErrorHandler.php(55): yii\base\Component->trigger()
#13 [internal function]: craft\web\ErrorHandler->handleException()
#14 {main}

Next yii\db\Exception: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'siteId' in 'where clause'
The SQL being executed was: SELECT `settings`
FROM `sprout_settings`
WHERE (`siteId`=1) AND (`moduleId`='sprout-module-redirects') AND (`name`='siteExcludedUrlPatterns') in /var/www/html/vendor/yiisoft/yii2/db/Schema.php:676
Stack trace:
#0 /var/www/html/vendor/yiisoft/yii2/db/Command.php(1325): yii\db\Schema->convertException()
#1 /var/www/html/vendor/yiisoft/yii2/db/Command.php(1186): yii\db\Command->internalExecute()
#2 /var/www/html/vendor/yiisoft/yii2/db/Command.php(443): yii\db\Command->queryInternal()
#3 /var/www/html/vendor/yiisoft/yii2/db/Query.php(304): yii\db\Command->queryScalar()
#4 /var/www/html/vendor/barrelstrength/sprout/src/redirects/RedirectsSettings.php(136): yii\db\Query->scalar()
#5 /var/www/html/vendor/barrelstrength/sprout/src/redirects/RedirectsSettings.php(147): BarrelStrength\Sprout\redirects\RedirectsSettings->getSiteExcludedUrlPatterns()
#6 /var/www/html/vendor/barrelstrength/sprout/src/redirects/redirects/Redirects.php(73): BarrelStrength\Sprout\redirects\RedirectsSettings->getExcludedUrlPatterns()
#7 /var/www/html/vendor/barrelstrength/sprout/src/redirects/redirects/Redirects.php(54): BarrelStrength\Sprout\redirects\redirects\Redirects->processRedirectsForCurrentRequest()
#8 /var/www/html/vendor/barrelstrength/sprout/src/redirects/RedirectsModule.php(162): BarrelStrength\Sprout\redirects\redirects\Redirects->handleRedirectsOnException()
#9 [internal function]: BarrelStrength\Sprout\redirects\RedirectsModule::BarrelStrength\Sprout\redirects\{closure}()
#10 /var/www/html/vendor/yiisoft/yii2/base/Event.php(312): call_user_func()
#11 /var/www/html/vendor/yiisoft/yii2/base/Component.php(654): yii\base\Event::trigger()
#12 /var/www/html/vendor/craftcms/cms/src/web/ErrorHandler.php(55): yii\base\Component->trigger()
#13 [internal function]: craft\web\ErrorHandler->handleException()
#14 {main}
Additional Information:
Array
(
    [0] => 42S22
    [1] => 1054
    [2] => Unknown column 'siteId' in 'where clause'
)

  thrown in /var/www/html/vendor/yiisoft/yii2/db/Schema.php:676
Stack trace:
#0 [internal function]: yii\base\ErrorHandler->handleFatalError()
#1 {main}

Using the Lite version with no Multisite support, the site_id column is indeed missing in the database.

How to reproduce

  1. Install the Lite plugin
  2. Configure any redirect
  3. Trigger the redirect

Sprout Version

Redirects 5.0.3, Data Studio 5.0.3, Sprout package 5.0.6

Craft Version

5.7.5

Database Type Version

MariaDB 10.4.x

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions