Commit c2faa36a authored by Carsten  Rose's avatar Carsten Rose
Browse files

Bug #4548 /Template Group: 'form-update' broken - max tg element value/index...

Bug #4548 /Template Group: 'form-update' broken - max tg element value/index shown after save instead of last user supplied value, but save is ok.
Neu wird nach dem Speichern das Formular nochmal komplett geladen. Das ist wichtig um die durch aftersave geaenderten Records in die Formularelemente zu bekommen.
parent d54e50fa
......@@ -158,7 +158,7 @@ abstract class AbstractBuildForm {
* @throws DbException
* @throws \qfq\UserFormException
*/
public function process($mode, $htmlElementNameIdZero = false) {
public function process($mode, $htmlElementNameIdZero = false, $latestFeSpecNative = array()) {
$htmlHead = '';
$htmlTail = '';
$htmlT3vars = '';
......@@ -166,6 +166,10 @@ abstract class AbstractBuildForm {
$htmlElements = '';
$json = array();
if (!empty($latestFeSpecNative)) {
$this->feSpecNative = $latestFeSpecNative;
}
$modeCollectFe = FLAG_DYNAMIC_UPDATE;
$storeUse = STORE_USE_DEFAULT;
......@@ -531,7 +535,7 @@ abstract class AbstractBuildForm {
continue; // skip this FE
}
$flagOutput = ($fe[FE_TYPE] !== FE_TYPE_EXTRA); // type='extra' will not displayed and not transmitted to the form
$flagOutput = ($fe[FE_TYPE] !== FE_TYPE_EXTRA); // type='extra' will not displayed and not transmitted to the form.
$debugStack = array();
......
......@@ -411,10 +411,14 @@ class QuickFormQuery {
}
if ($getJson) {
// Values of FormElements might be changed during 'afterSave': rebuild the form to load the new values. Especially for advanced template groups.
$this->loadFormSpecification($formMode, $recordId, $foundInStore);
// Retrieve FE Values as JSON
// $data['form-update']=...
// $data = $build->process($formMode, $htmlElementNameIdZero);
$data = $build->process($formMode);
$data = $build->process($formMode, false, $this->feSpecNative);
}
break;
......
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