-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Show notice for non existent controller property. #12593
Conversation
src/Controller/Controller.php
Outdated
@@ -371,6 +371,19 @@ public function __get($name) | |||
|
|||
list($plugin, $class) = pluginSplit($this->modelClass, true); | |||
if ($class !== $name) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe reverse if
and explain:
if ($class === $name) {
// Autoload table if $name matches controller name
return $this->loadModel($plugin . $class);
}
// notice
return false; // remove or explicitly return null at 4.x
Looks like we have a few undefined properties being used by our tests 😢 |
Not really, the error doesn't make sense. It's complaining about missing |
cakephp/src/View/ViewVarsTrait.php Lines 75 to 78 in 13ab4d7
If second |
@garas Good find, I'll adjust the code to mitigate this. |
This avoid triggering Controller::__get() on subsequent access to ViewVarsTrait::$viewClass.
|
Add alias in |
Meh, took care of it with a |
Refs #12590 (comment)