mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
FIX Call defineMethods if lower method is missing
This commit is contained in:
parent
ba97de9458
commit
89213c90ec
@ -171,11 +171,14 @@ trait CustomMethods
|
||||
}
|
||||
// Lazy define methods
|
||||
$lowerClass = strtolower(static::class);
|
||||
if (!isset(self::class::$extra_methods[$lowerClass])) {
|
||||
$lowerMethod = strtolower($method);
|
||||
if (!array_key_exists($lowerClass, self::class::$extra_methods)
|
||||
|| !array_key_exists($lowerMethod, self::class::$extra_methods[$lowerClass])
|
||||
) {
|
||||
$this->defineMethods();
|
||||
}
|
||||
|
||||
return self::class::$extra_methods[$lowerClass][strtolower($method)] ?? null;
|
||||
return self::class::$extra_methods[$lowerClass][$lowerMethod] ?? null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user