mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR If a FormField hasn't called parent::__construct() properly, throw an error before attempting to call ClassInfo::ancestry() on a NULL value
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@78129 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
b0798db91e
commit
4da2743994
@ -22,6 +22,9 @@ class FormTransformation extends Object {
|
||||
|
||||
// We iterate through each array simultaneously, looking at [0] of both, then [1] of both.
|
||||
// This provides a more natural failover scheme.
|
||||
if(!$field->class) {
|
||||
user_error(get_class($field) . ' is missing a class property, please ensure constructors call parent', E_USER_ERROR);
|
||||
}
|
||||
|
||||
$transNames = array_reverse(array_values(ClassInfo::ancestry($this->class)));
|
||||
$fieldClasses = array_reverse(array_values(ClassInfo::ancestry($field->class)));
|
||||
|
Loading…
Reference in New Issue
Block a user