-
Notifications
You must be signed in to change notification settings - Fork 2
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
Crashes craft with error on install #4
Comments
Hi @havardlj thanks for raising this issue and apologies for not getting back to you before now, for some reason I missed the notification. I'll look into this as soon as I can and get back to you, hopefully with a fix. |
I think I just encountered the same issue. Added recaptchaguest via plugin store, everything was fine, then added recaptcha (v2) via plugin store and got a similar error report as shown above. Was there a resolution on this? Any tips on how to fix or what to explore? Craft 3.5.17.1 Error: Call to a member function getSettings() on null in /Users/person/project/online/vendor/billythekid/recaptchaguest/src/Recaptchaguest.php:61 |
Hi @havardlj and @camelskyscraper, I've been able to replicate this today. I think it's because of installing the recaptcha plugin from the plugin store after installing this one. This plugin installs the recaptcha one as a dependency anyway so that step shouldn't be required. I'm not sure why actually requiring it seperately should have any effect whatsoever though. It shouldn't make a difference if it's explicitly requried in your own composer.json or installed as a dependency via this package. Nevertheless I plan on getting to the bottom of this and releasing a fix shortly. Thanks to you both for bringing this up. |
Hi again @havardlj and @camelskyscraper, I've just released an update that fixed this in my testing. Turns out it was some weird thing where Craft was reporting the recaptcha plugin as being installed and loaded, but actually trying to access it was giving null. A bit of re-organising the code so it doesn't check until the event fires (so all plugins really ARE loaded) seems to have done the trick. Please let me know how you get on and if you need anything more. Cheers, |
Thank you @billythekid for following up on this. The project I was working on was delayed and finally restarted so I would like to see it your update fixes the issue I was having. I don't see an update in my control panel Updates list for this plugin, though. The installed version of recaptchaguest is 1.0.4. I apologize for my ignorance on how to proceed. Can you point me in the right direction, please? edit — if it matters, I just updated Craft to 3.6.1 |
Hi @camelskyscraper I just checked packagist and it's showing 1.0.5 so not sure why it's not alerting to an update. Might be some other meta thing. Will check ASAP and let you know. |
Exception 'Error' with message 'Call to a member function getSettings() on null'
in /Users/myuser/Dev/myproject.dev/vendor/billythekid/recaptchaguest/src/Recaptchaguest.php:61
Stack trace:
#0 /Users/myuser/Dev/myproject.dev/vendor/yiisoft/yii2/base/BaseObject.php(109): billythekid\recaptchaguest\Recaptchaguest->init()
#1 /Users/myuser/Dev/myproject.dev/vendor/yiisoft/yii2/base/Module.php(158): yii\base\BaseObject->__construct(Array)
#2 /Users/myuser/Dev/myproject.dev/vendor/craftcms/cms/src/base/Plugin.php(115): yii\base\Module->__construct('recaptchaguest', Object(craft\console\Application), Array)
#3 [internal function]: craft\base\Plugin->__construct('recaptchaguest', Object(craft\console\Application), Array)
#4 /Users/myuser/Dev/myproject.dev/vendor/yiisoft/yii2/di/Container.php(406): ReflectionClass->newInstanceArgs(Array)
#5 /Users/myuser/Dev/myproject.dev/vendor/yiisoft/yii2/di/Container.php(165): yii\di\Container->build('billythekid\rec...', Array, Array)
#6 /Users/myuser/Dev/myproject.dev/vendor/yiisoft/yii2/BaseYii.php(365): yii\di\Container->get('billythekid\rec...', Array, Array)
#7 /Users/myuser/Dev/myproject.dev/vendor/craftcms/cms/src/services/Plugins.php(908): yii\BaseYii::createObject(Array, Array)
#8 /Users/myuser/Dev/myproject.dev/vendor/craftcms/cms/src/services/Plugins.php(227): craft\services\Plugins->createPlugin('recaptchaguest', Array)
#9 /Users/myuser/Dev/myproject.dev/vendor/craftcms/cms/src/base/ApplicationTrait.php(1416): craft\services\Plugins->loadPlugins()
#10 /Users/myuser/Dev/myproject.dev/vendor/craftcms/cms/src/console/Application.php(61): craft\console\Application->_postInit()
#11 /Users/myuser/Dev/myproject.dev/vendor/yiisoft/yii2/base/BaseObject.php(109): craft\console\Application->init()
#12 /Users/myuser/Dev/myproject.dev/vendor/yiisoft/yii2/base/Application.php(206): yii\base\BaseObject->__construct(Array)
#13 /Users/myuser/Dev/myproject.dev/vendor/yiisoft/yii2/console/Application.php(89): yii\base\Application->__construct(Array)
#14 /Users/myuser/Dev/myproject.dev/vendor/craftcms/cms/src/console/Application.php(50): yii\console\Application->__construct(Array)
#15 [internal function]: craft\console\Application->__construct(Array)
#16 /Users/myuser/Dev/myproject.dev/vendor/yiisoft/yii2/di/Container.php(406): ReflectionClass->newInstanceArgs(Array)
#17 /Users/myuser/Dev/myproject.dev/vendor/yiisoft/yii2/di/Container.php(165): yii\di\Container->build('craft\console\A...', Array, Array)
#18 /Users/myuser/Dev/myproject.dev/vendor/yiisoft/yii2/BaseYii.php(365): yii\di\Container->get('craft\console\A...', Array, Array)
#19 /Users/myuser/Dev/myproject.dev/vendor/craftcms/cms/bootstrap/bootstrap.php(246): yii\BaseYii::createObject(Array)
#20 /Users/myuser/Dev/myproject.dev/vendor/craftcms/cms/bootstrap/console.php(51): require('/Users/myuser...')
#21 /Users/myuser/Dev/myproject.dev/craft(22): require('/Users/myuser...')
#22 {main}
The text was updated successfully, but these errors were encountered: