mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
CustomMethods->removeMethodsFrom Warnings
Check to ensure `self::$extra_methods[$class][$method]` exists before trying to retrieve its value. Silences warnings generated by updating a controller's failover.
This commit is contained in:
parent
937d73fefc
commit
afceccb9a6
@ -279,10 +279,12 @@ trait CustomMethods
|
||||
$methods = $this->findMethodsFromExtension($extension);
|
||||
if ($methods) {
|
||||
foreach ($methods as $method) {
|
||||
$methodInfo = self::$extra_methods[$class][$method];
|
||||
if (isset(self::$extra_methods[$class][$method])) {
|
||||
$methodInfo = self::$extra_methods[$class][$method];
|
||||
|
||||
if ($methodInfo['property'] === $property && $methodInfo['index'] === $index) {
|
||||
unset(self::$extra_methods[$class][$method]);
|
||||
if ($methodInfo['property'] === $property && $methodInfo['index'] === $index) {
|
||||
unset(self::$extra_methods[$class][$method]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user