mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Better error messages when HasManyComplexTableField can't configure itself properly.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@69731 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
9f0caaa2bf
commit
6ff158cee4
@ -32,6 +32,7 @@ class HasManyComplexTableField extends ComplexTableField {
|
||||
|
||||
if($controllerClass = $this->controllerClass()) {
|
||||
$this->joinField = $this->getParentIdName($controllerClass, $this->sourceClass);
|
||||
if(!$this->joinField) user_error("Can't find a has_one relationship from '$this->sourceClass' to '$controllerClass'", E_USER_WARNING);
|
||||
} else {
|
||||
user_error("Can't figure out the data class of $controller", E_USER_WARNING);
|
||||
}
|
||||
@ -148,6 +149,11 @@ class HasManyComplexTableField_Item extends ComplexTableField_Item {
|
||||
function MarkingCheckbox() {
|
||||
$name = $this->parent->Name() . '[]';
|
||||
|
||||
if(!$this->parent->joinField) {
|
||||
user_error("joinField not set in HasManyComplexTableField '{$this->parent->name}'", E_USER_WARNING);
|
||||
return null;
|
||||
}
|
||||
|
||||
$joinVal = $this->item->{$this->parent->joinField};
|
||||
$parentID = $this->parent->getControllerID();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user