CleanTalk / craft-antispam

CraftCMS plugin `Anti-Spam protection by CleanTalk`
MIT License
1 stars 0 forks source link

Plugin registration causes fatal error #1

Open ammonhaggerty opened 3 months ago

ammonhaggerty commented 3 months ago

I installed the plugin and registered an account on CleatTalk. When I added the access key, the admin console threw a generic PHP error which took down both the live website and Craft CP environment. I had to uninstall the plugin and roll back the Composer config.

I'm running Craft version 4.8.0, PHP 8.1.2

Here's the error from the logs: 2024-03-03 18:05:53 [web.ERROR] [Error] Class "craft\contactform\models\Submission" not found {"trace":["#0 /storage/av09497/www/sndout_html/vendor/cleantalk/craft-antispam/src/CraftAntispam.php(28): Cleantalk\\CraftAntispam\\CraftAntispam->registerEvents()","#1 /storage/av09497/www/sndout_html/vendor/yiisoft/yii2/base/BaseObject.php(109): Cleantalk\\CraftAntispam\\CraftAntispam->init()","#2 /storage/av09497/www/sndout_html/vendor/yiisoft/yii2/base/Module.php(161): yii\\base\\BaseObject->__construct()","#3 /storage/av09497/www/sndout_html/vendor/craftcms/cms/src/base/Plugin.php(122): yii\\base\\Module->__construct()","#4 [internal function]: craft\\base\\Plugin->__construct()","#5 /storage/av09497/www/sndout_html/vendor/yiisoft/yii2/di/Container.php(419): ReflectionClass->newInstanceArgs()","#6 /storage/av09497/www/sndout_html/vendor/yiisoft/yii2/di/Container.php(170): yii\\di\\Container->build()","#7 /storage/av09497/www/sndout_html/vendor/yiisoft/yii2/BaseYii.php(365): yii\\di\\Container->get()","#8 /storage/av09497/www/sndout_html/vendor/craftcms/cms/src/Craft.php(59): yii\\BaseYii::createObject()","#9 /storage/av09497/www/sndout_html/vendor/craftcms/cms/src/services/Plugins.php(943): Craft::createObject()","#10 /storage/av09497/www/sndout_html/vendor/craftcms/cms/src/services/Plugins.php(228): craft\\services\\Plugins->createPlugin()","#11 /storage/av09497/www/sndout_html/vendor/craftcms/cms/src/base/ApplicationTrait.php(1649): craft\\services\\Plugins->loadPlugins()","#12 /storage/av09497/www/sndout_html/vendor/craftcms/cms/src/web/Application.php(111): craft\\web\\Application->_postInit()","#13 /storage/av09497/www/sndout_html/vendor/yiisoft/yii2/base/BaseObject.php(109): craft\\web\\Application->init()","#14 /storage/av09497/www/sndout_html/vendor/yiisoft/yii2/base/Application.php(204): yii\\base\\BaseObject->__construct()","#15 [internal function]: yii\\base\\Application->__construct()","#16 /storage/av09497/www/sndout_html/vendor/yiisoft/yii2/di/Container.php(419): ReflectionClass->newInstanceArgs()","#17 /storage/av09497/www/sndout_html/vendor/yiisoft/yii2/di/Container.php(170): yii\\di\\Container->build()","#18 /storage/av09497/www/sndout_html/vendor/yiisoft/yii2/BaseYii.php(365): yii\\di\\Container->get()","#19 /storage/av09497/www/sndout_html/vendor/craftcms/cms/src/Craft.php(59): yii\\BaseYii::createObject()","#20 /storage/av09497/www/sndout_html/vendor/craftcms/cms/bootstrap/bootstrap.php(250): Craft::createObject()","#21 /storage/av09497/www/sndout_html/vendor/craftcms/cms/bootstrap/web.php(40): require('/storage/av0949...')","#22 /storage/av09497/www/sndout_html/public/index.php(11): require('/storage/av0949...')","#23 {main}"],"memory":1260104,"exception":"[object] (Error(code: 0): Class \"craft\\contactform\\models\\Submission\" not found at /storage/av09497/www/sndout_html/vendor/cleantalk/craft-antispam/src/CraftAntispam.php:52)"}

alexandergull commented 3 months ago

Hello @ammonhaggerty

We will check this within a few days.

Thank you.

Glomberg commented 3 months ago

Hello @ammonhaggerty

For now the Anti-Spam solution support only craft-based contact form - https://plugins.craftcms.com/contact-form (this described in the readme)

Please, install this contact form to enable protection without any errors.

For our side we will implement checking the contact form installed to prevent these errors in the future.

Is this solved your issue?