mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 17:05:42 +02:00
ENHANCEMENT: return false if no fields have been added to a UserDefinedForm rather than a blank form
This commit is contained in:
parent
1feab6d401
commit
9bb51b6cea
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user