From 1896bff08c916915296c0937b8e56349aeda772b Mon Sep 17 00:00:00 2001 From: Normann Lou Date: Wed, 16 Jan 2008 03:54:33 +0000 Subject: [PATCH] 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 --- forms/TableField.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/forms/TableField.php b/forms/TableField.php index 4f13c6dd2..190b17587 100644 --- a/forms/TableField.php +++ b/forms/TableField.php @@ -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";