$this->request in Controller somehow becomes a string which causes getIsLivePreview() to error out when loading some plugins.
Error: Call to a member function getIsLivePreview() on string in /application/vendor/craftcms/cms/src/web/Controller.php:133
Stack trace:
#0 /application/vendor/yiisoft/yii2/base/Controller.php(178): craft\web\Controller->beforeAction(Object(yii\base\InlineAction))
#1 /application/vendor/craftcms/cms/src/web/Controller.php(181): yii\base\Controller->runAction('default-view', Array)
#2 /application/vendor/yiisoft/yii2/base/Module.php(528): craft\web\Controller->runAction('default-view', Array)
#3 /application/vendor/craftcms/cms/src/web/Application.php(295): yii\base\Module->runAction('calendar/settin...', Array)
#4 /application/vendor/yiisoft/yii2/web/Application.php(103): craft\web\Application->runAction('calendar/settin...', Array)
#5 /application/vendor/craftcms/cms/src/web/Application.php(280): yii\web\Application->handleRequest(Object(craft\web\Request))
#6 /application/vendor/yiisoft/yii2/base/Application.php(386): craft\web\Application->handleRequest(Object(craft\web\Request))
#7 /application/web/index.php(61): yii\base\Application->run()
#8 {main}
Actually wtf.. i did not know request can be a string.
https://www.yiiframework.com/doc/api/2.0/yii-base-controller#$request-detail
https://github.com/yiisoft/yii2/blob/master/framework/base/Controller.php#L72
@brandonkelly do you have any idea about this? The request should be loaded already into the controller, since beforeAction happens after init, right?
+1 Freeform 3.7.0
Issue, at least in Calendar鈥檚 settings case, is that the init() method is not calling parent::init(). With Yii components, any time you create an init() method, you should always call parent::init() before anything else.
Guessing this will generally be the culprit when this error comes up. There are other bugs that would come from not calling parent::init() as well though, like $allowAnonymous not getting normalized properly.
(Will mention this to Solspace.)
Most helpful comment
(Will mention this to Solspace.)