diff --git a/plugins/ktcore/KTValidators.php b/plugins/ktcore/KTValidators.php index c5b5a3e..06eb766 100644 --- a/plugins/ktcore/KTValidators.php +++ b/plugins/ktcore/KTValidators.php @@ -249,8 +249,6 @@ class KTRequiredFileValidator extends KTValidator { $val = KTUtil::arrayGet($_FILES, $this->sInputVariable); if (empty($val) || empty($val['name'])) { $errors[$this->sBasename] = _kt("You must select a file to upload."); - }else{ - $errors[$this->sBasename] = _kt("Please reselect the file to upload."); } return array( diff --git a/plugins/ktcore/folder/addDocument.php b/plugins/ktcore/folder/addDocument.php index 7f6c1d1..6eaeefa 100644 --- a/plugins/ktcore/folder/addDocument.php +++ b/plugins/ktcore/folder/addDocument.php @@ -185,7 +185,10 @@ class KTFolderAddDocumentAction extends KTFolderAction { $oForm = $this->form_initialdata(); $res = $oForm->validate(); if (!empty($res['errors'])) { - return $oForm->handleError(); + if(!isset($res['errors']['file'])){ + $aError['file'] = array(_kt('Please reselect the file to upload.')); + } + return $oForm->handleError('', $aError); } $data = $res['results']; $key = KTUtil::randomString(32);