File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
components/com_contact/src/Controller Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -171,12 +171,23 @@ public function submit()
171171 // Validation succeeded, continue with custom handlers
172172 $ results = $ this ->app ->triggerEvent ('onValidateContact ' , [&$ contact , &$ data ]);
173173
174+ $ passValidation = true ;
175+
174176 foreach ($ results as $ result ) {
175177 if ($ result instanceof \Exception) {
176- return false ;
178+ $ passValidation = false ;
179+ $ app ->enqueueMessage ($ result ->getMessage (), 'error ' );
177180 }
178181 }
179182
183+ if (!$ passValidation ) {
184+ $ app ->setUserState ('com_contact.contact.data ' , $ data );
185+
186+ $ this ->setRedirect (Route::_ ('index.php?option=com_contact&view=contact&id= ' . $ id . '&catid= ' . $ contact ->catid , false ));
187+
188+ return false ;
189+ }
190+
180191 // Passed Validation: Process the contact plugins to integrate with other applications
181192 $ this ->app ->triggerEvent ('onSubmitContact ' , [&$ contact , &$ data ]);
182193
You can’t perform that action at this time.
0 commit comments