Commit 65885d0d authored by Carsten  Rose's avatar Carsten Rose

Merge branch 'B9532upload-FileDestination' into 'master'

Fixes #9532. slaveId/sqlUpdate/... have been processed two times, after multiform code changes.

See merge request !199
parents c6386c03 2baed3df
Pipeline #2677 passed with stages
in 2 minutes and 35 seconds
......@@ -9,16 +9,15 @@
namespace IMATHUZH\Qfq\Core\Form;
use IMATHUZH\Qfq\Core\Database\Database;
use IMATHUZH\Qfq\Core\Evaluate;
use IMATHUZH\Qfq\Core\Helper\HelperFile;
use IMATHUZH\Qfq\Core\Helper\HelperFormElement;
use IMATHUZH\Qfq\Core\Helper\Ldap;
use IMATHUZH\Qfq\Core\Helper\Logger;
use IMATHUZH\Qfq\Core\Helper\OnArray;
use IMATHUZH\Qfq\Core\Helper\Support;
use IMATHUZH\Qfq\Core\Store\Store;
use IMATHUZH\Qfq\Core\Evaluate;
use IMATHUZH\Qfq\Core\Report\SendMail;
use IMATHUZH\Qfq\Core\Helper\HelperFormElement;
use IMATHUZH\Qfq\Core\Store\Store;
/**
......@@ -126,7 +125,7 @@ class FormAction {
// Preparation for Log, Debug
$this->store->setVar(SYSTEM_FORM_ELEMENT, Logger::formatFormElementName($fe), STORE_SYSTEM); // debug
$this->store->setVar(SYSTEM_FORM_ELEMENT_ID, $fe[FE_ID]??'', STORE_SYSTEM); // debug
$this->store->setVar(SYSTEM_FORM_ELEMENT_ID, $fe[FE_ID] ?? '', STORE_SYSTEM); // debug
$fe = HelperFormElement::initActionFormElement($fe);
......@@ -176,7 +175,7 @@ class FormAction {
break;
default:
// Always work on recent data: previous actions might have modified the data.
$this->store->fillStoreWithRecord($this->primaryTableName, $recordId, $this->db, $this->formSpec[F_PRIMARY_KEY]??'');
$this->store->fillStoreWithRecord($this->primaryTableName, $recordId, $this->db, $this->formSpec[F_PRIMARY_KEY] ?? '');
}
if (!$this->checkRequiredList($fe)) {
......@@ -284,7 +283,7 @@ class FormAction {
$args[] = SENDMAIL_TOKEN_BODY_MODE . PARAM_TOKEN_DELIMITER . $this->evaluate->parse($feSpecAction[FE_SENDMAIL_BODY_MODE]);
$args[] = SENDMAIL_TOKEN_BODY_HTML_ENTITY . PARAM_TOKEN_DELIMITER . $this->evaluate->parse($feSpecAction[FE_SENDMAIL_BODY_HTML_ENTITY]);
$args[] = SENDMAIL_TOKEN_SUBJECT_HTML_ENTITY . PARAM_TOKEN_DELIMITER . $this->evaluate->parse($feSpecAction[FE_SENDMAIL_SUBJECT_HTML_ENTITY]);
$args[] = $this->evaluate->parse($feSpecAction[FE_SENDMAIL_ATTACHMENT]??'');
$args[] = $this->evaluate->parse($feSpecAction[FE_SENDMAIL_ATTACHMENT] ?? '');
// Mail: send
$sendMail = new SendMail();
......@@ -338,7 +337,7 @@ class FormAction {
$msg = $this->evaluate->parse($fe[FE_MESSAGE_FAIL]); // Replace possible dynamic parts
// Throw user error message
throw new \UserFormException( json_encode([ERROR_MESSAGE_TO_USER => $msg, ERROR_MESSAGE_TO_DEVELOPER => 'validate() failed']), ERROR_REPORT_FAILED_ACTION);
throw new \UserFormException(json_encode([ERROR_MESSAGE_TO_USER => $msg, ERROR_MESSAGE_TO_DEVELOPER => 'validate() failed']), ERROR_REPORT_FAILED_ACTION);
}
......@@ -360,6 +359,11 @@ class FormAction {
*/
public function doSqlBeforeSlaveAfter(array $fe, $recordId, $flagFeAction) {
// Uploads will be processed later.
if ($fe[FE_TYPE] == FE_TYPE_UPLOAD) {
return ACTION_ELEMENT_NO_CHANGE;
}
$rcStatus = ACTION_ELEMENT_NO_CHANGE;
$this->feFillStoreVar($fe[FE_FILL_STORE_VAR] ?? '');
......
......@@ -336,7 +336,7 @@ class Save {
private function isColumnUploadField($feName) {
foreach ($this->feSpecNative AS $formElement) {
if ($formElement[FE_NAME] === $feName && $formElement[FE_TYPE] == 'upload')
if ($formElement[FE_NAME] === $feName && $formElement[FE_TYPE] == FE_TYPE_UPLOAD)
return true;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment