ENHANCEMENT: return false if no fields have been added to a UserDefinedForm rather than a blank form

This commit is contained in:
Will Rossiter 2010-12-19 00:40:53 +00:00
parent 1feab6d401
commit 9bb51b6cea

View File

@ -345,10 +345,12 @@ class UserDefinedForm_Controller extends Page_Controller {
* Get the form for the page. Form can be modified by calling {@link updateForm()}
* on a UserDefinedForm extension
*
* @return Form
* @return Form|false
*/
function Form() {
$fields = $this->getFormFields();
if(!$fields) return false;
$actions = $this->getFormActions();
// get the required fields including the validation