mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Update conditional logic when checking array keys before removing methods in CustomMethods
This commit is contained in:
parent
52a039f631
commit
1a2dbfd3a5
@ -288,8 +288,8 @@ trait CustomMethods
|
|||||||
if (
|
if (
|
||||||
// always check for property
|
// always check for property
|
||||||
(isset($methodInfo['property']) && $methodInfo['property'] === $property) &&
|
(isset($methodInfo['property']) && $methodInfo['property'] === $property) &&
|
||||||
// check for index only if provided (otherwise assume true)
|
// check for index only if provided
|
||||||
(($index && isset($methodInfo['index']) && $methodInfo['index'] === $index) || true)
|
(!$index || ($index && isset($methodInfo['index']) && $methodInfo['index'] === $index))
|
||||||
) {
|
) {
|
||||||
unset(self::$extra_methods[$class][$method]);
|
unset(self::$extra_methods[$class][$method]);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user