WIP: Road to 1.0.0 #1

Draft
miguel456 wants to merge 123 commits from develop into master
1 changed files with 8 additions and 0 deletions
Showing only changes of commit 6cc99d2ebe - Show all commits

View File

@ -33,6 +33,14 @@ class FormController extends Controller
$this->authorize('create', Form::class); $this->authorize('create', Form::class);
$fields = $request->all(); $fields = $request->all();
if (count($fields) == 2)
{
// form is probably empty, since forms with fields will alawys have more than 2 items
$request->session()->flash('error', 'Sorry, but you may not create empty forms.');
return redirect()->to(route('showForms'));
}
$contextValidation = ContextAwareValidator::getValidator($fields, true, true); $contextValidation = ContextAwareValidator::getValidator($fields, true, true);
if (!$contextValidation->get('validator')->fails()) if (!$contextValidation->get('validator')->fails())