Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
0
Help us understand the problem. What is going on with this article?
@eltociear

🍰【CakePHP2】Error: Call to a member function dispatchMethod() on nullは環境設定で修正

More than 1 year has passed since last update.

環境

PHP 7.2.21
CakePHP 2.10.18

やりたいこと

下記のエラーを修正

Error: Call to a member function dispatchMethod() on null
#0 (Modelのファイルパス)(223): Model->__call('makeRoleTargetJ...', Array)
#1 [internal function]: (対象のModel名)->__construct(Array)
#2 /(CakePHPディレクトリ)/Vendor/cakephp/cakephp/lib/Cake/Utility/ClassRegistry.php(169): ReflectionClass->newInstance(Array)
#3 /(CakePHPディレクトリ)/Vendor/cakephp/cakephp/lib/Cake/Console/Shell.php(316): ClassRegistry::init('(対象のModel名)')
#4 /(CakePHPディレクトリ)/Vendor/cakephp/cakephp/lib/Cake/Console/Shell.php(269): Shell->loadModel('(対象のModel名)')
#5 /(CakePHPディレクトリ)/Vendor/cakephp/cakephp/lib/Cake/Console/Shell.php(228): Shell->_loadModels()
#6 /(CakePHPディレクトリ)/Vendor/cakephp/cakephp/lib/Cake/Console/ShellDispatcher.php(221): Shell->initialize()
#7 /(CakePHPディレクトリ)/Vendor/cakephp/cakephp/lib/Cake/Console/ShellDispatcher.php(66): ShellDispatcher->dispatch()
#8 /(CakePHPディレクトリ)/(Projectディレクトリ)/Console/cake.php(48): ShellDispatcher::run(Array)
#9 {main}

やったこと

env.phpの環境変数を確認して修正する
ModelやControllerは悪くなかった

0
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
eltociear
アウトプットで知識整理していきます 間違い等ありましたら気軽にコメントしてください

Comments

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
0
Help us understand the problem. What is going on with this article?