putyourlightson / craft-campaign

Send and manage email campaigns, contacts and mailing lists in Craft CMS.
https://putyourlightson.com/plugins/campaign
Other
63 stars 25 forks source link

Error when running cron #459

Closed billymedia closed 8 months ago

billymedia commented 8 months ago

When i try and run this from the command line:

/usr/bin/php /sites/public_html/craft campaign/sendouts/run

I get this error message:

Exception 'yii\base\UnknownMethodException' with message 'Calling unknown method: craft\console\Request::getParam()'

Not sure what info you need to help with this, any ideas?

bencroker commented 8 months ago

The rest of the stack trace would be helpful, which will allow me to narrow down the issue to a specific file. You’ll see it if devMode is enabled, otherwise it should appear in one of the log files in storage/logs.

It might be worth verifying that you down have craft.app.request.getParam() anywhere in your email templates, which could be triggering this error.

billymedia commented 8 months ago

I checked the template and there is no getParam, here is the stack trace:

#0 /sites/public_html/modules/subscriber/Subscriber.php(49): yii\base\Component->__call()
#1 [internal function]: modules\subscriber\Subscriber->modules\subscriber\{closure}()
#2 /sites/public_html/vendor/yiisoft/yii2/base/Event.php(312): call_user_func()
#3 /sites/public_html/vendor/yiisoft/yii2/base/Component.php(642): yii\base\Event::trigger()
#4 /sites/public_html/vendor/yiisoft/yii2/base/Module.php(724): yii\base\Component->trigger()
#5 /sites/public_html/vendor/yiisoft/yii2/base/Controller.php(166): yii\base\Module->beforeAction()
#6 /sites/public_html/vendor/yiisoft/yii2/console/Controller.php(180): yii\base\Controller->runAction()
#7 /sites/public_html/vendor/yiisoft/yii2/base/Module.php(552): yii\console\Controller->runAction()
#8 /sites/public_html/vendor/yiisoft/yii2/console/Application.php(180): yii\base\Module->runAction()
#9 /sites/public_html/vendor/craftcms/cms/src/console/Application.php(91): yii\console\Application->runAction()
#10 /sites/public_html/vendor/yiisoft/yii2/console/Application.php(147): craft\console\Application->runAction()
#11 /sites/public_html/vendor/craftcms/cms/src/console/Application.php(122): yii\console\Application->handleRequest()
#12 /sites/public_html/vendor/yiisoft/yii2/base/Application.php(384): craft\console\Application->handleRequest()
#13 /sites/public_html/craft(13): yii\base\Application->run()
#14 {main}
bencroker commented 8 months ago

So the error is clearly in modules/subscriber/Subscriber.php at line 49. Is that a custom module you created?

billymedia commented 8 months ago

I'm such an idiot. Sorry for wasting your time with this. 🤦

bencroker commented 8 months ago

No problem. Sounds like you figured it out!