Commit 6d0b7059 authored by Carsten  Rose's avatar Carsten Rose
Browse files

QuickFormQuery.php, FormAction.php: '#2931 / afterSave Hauptrecord xId nicht...

QuickFormQuery.php, FormAction.php: '#2931 / afterSave Hauptrecord xId nicht direkt verfügbar' - load master record again, after 'action'-elements has been processed.
parent 2d6a074d
...@@ -278,7 +278,11 @@ class QuickFormQuery { ...@@ -278,7 +278,11 @@ class QuickFormQuery {
$save->processAllUploads($rc); $save->processAllUploads($rc);
// Action: After // Action: After
$formAction->elements($rc, $this->feSpecAction, FE_TYPE_AFTER_INSERT . ',' . FE_TYPE_AFTER_UPDATE . ',' . FE_TYPE_AFTER_SAVE); $modified = $formAction->elements($rc, $this->feSpecAction, FE_TYPE_AFTER_INSERT . ',' . FE_TYPE_AFTER_UPDATE . ',' . FE_TYPE_AFTER_SAVE);
if ($modified) {
// Reload fresh saved record and fill STORE_RECORD with it.
$this->fillStoreRecord($this->formSpec[F_TABLE_NAME], $rc);
}
$htmlElementNameIdZero = false; $htmlElementNameIdZero = false;
// Retrieve current STORE_SIP. // Retrieve current STORE_SIP.
......
...@@ -60,12 +60,15 @@ class FormAction { ...@@ -60,12 +60,15 @@ class FormAction {
* On FormLoad: FE_TYPE_BEFORE_LOAD, FE_TYPE_AFTER_LOAD * On FormLoad: FE_TYPE_BEFORE_LOAD, FE_TYPE_AFTER_LOAD
* Before Save: FE_TYPE_BEFORE_SAVE, FE_TYPE_BEFORE_INSERT, FE_TYPE_BEFORE_UPDATE, FE_TYPE_BEFORE_DELETE * Before Save: FE_TYPE_BEFORE_SAVE, FE_TYPE_BEFORE_INSERT, FE_TYPE_BEFORE_UPDATE, FE_TYPE_BEFORE_DELETE
* After Save: FE_TYPE_AFTER_SAVE, FE_TYPE_AFTER_INSERT, FE_TYPE_AFTER_UPDATE, FE_TYPE_AFTER_DELETE * After Save: FE_TYPE_AFTER_SAVE, FE_TYPE_AFTER_INSERT, FE_TYPE_AFTER_UPDATE, FE_TYPE_AFTER_DELETE
* @return bool: true if there are potential changes on the DB like fired SQL statements, else false.
* @throws CodeException * @throws CodeException
* @throws DbException * @throws DbException
* @throws UserFormException * @throws UserFormException
*/ */
public function elements($recordId, array $feSpecAction, $feTypeList) { public function elements($recordId, array $feSpecAction, $feTypeList) {
$flagModified = false;
// Iterate over all Action FormElements // Iterate over all Action FormElements
foreach ($feSpecAction as $fe) { foreach ($feSpecAction as $fe) {
...@@ -97,7 +100,11 @@ class FormAction { ...@@ -97,7 +100,11 @@ class FormAction {
$this->validate($fe); $this->validate($fe);
$this->doSlave($fe, $recordId); $this->doSlave($fe, $recordId);
$flagModified = true;
} }
return $flagModified;
} }
/** /**
......
Supports Markdown
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