AntonLV 6 سال پیش
والد
کامیت
cff1f70219
1فایلهای تغییر یافته به همراه9 افزوده شده و 2 حذف شده
  1. 9 2
      modules/base/general/classes/BxBaseModGeneralFormsEntryHelper.php

+ 9 - 2
modules/base/general/classes/BxBaseModGeneralFormsEntryHelper.php

@@ -187,8 +187,15 @@ class BxBaseModGeneralFormsEntryHelper extends BxDolProfileForms
         }
 
         $oForm->initChecker(array(), $aValues);
-        if (!$oForm->isSubmittedAndValid())
-            return array('code' => 2, 'message' => '_sys_txt_error_occured');
+        if (!$oForm->isSubmittedAndValid()) {
+            $aErrors = array();
+            array_walk($oForm->aInputs, function($aInput, $sKey) use (&$aErrors) {
+                if(!empty($aInput['error']))
+                    $aErrors[$sKey] = $aInput['error'];
+            });
+
+            return array('code' => 2, 'message' => '_sys_txt_error_occured', 'errors' => $aErrors);
+        }
 
         // insert data into database
         $aValsToAdd = array ();