fix bug: when no source items found, the table should still show and it should works as adding new records

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@48078 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Normann Lou 2008-01-16 03:54:33 +00:00
parent a1792c0e89
commit 1896bff08c

View File

@ -515,7 +515,7 @@ class TableField extends TableListField {
// TODO Implement custom requiredFields
$items = $this->sourceItems();
if($this->requiredFields&&$items->count()) {
if($items&&$this->requiredFields&&$items->count()) {
foreach ($this->requiredFields as $field) {
/*if($fields->dataFieldByName($field)) {
$js .= "\t\t\t\t\trequire('$field');\n";