mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Merge pull request #9271 from michalkleiner/pulls/4/check-array-props-in-custom-methods
FIX Check array keys existence when removing methods in CustomMethods
This commit is contained in:
commit
1265f09f4f
@ -285,7 +285,12 @@ trait CustomMethods
|
|||||||
|
|
||||||
$methodInfo = self::$extra_methods[$class][$method];
|
$methodInfo = self::$extra_methods[$class][$method];
|
||||||
|
|
||||||
if ($methodInfo['property'] === $property && $methodInfo['index'] === $index) {
|
if (
|
||||||
|
// always check for property
|
||||||
|
(isset($methodInfo['property']) && $methodInfo['property'] === $property) &&
|
||||||
|
// check for index only if provided
|
||||||
|
(!$index || ($index && isset($methodInfo['index']) && $methodInfo['index'] === $index))
|
||||||
|
) {
|
||||||
unset(self::$extra_methods[$class][$method]);
|
unset(self::$extra_methods[$class][$method]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user