Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
typo3
qfq
Commits
b73e7bcb
Commit
b73e7bcb
authored
Oct 13, 2019
by
Carsten Rose
Browse files
Refs #5695 Multiform: update values after saving.
parent
324a1ad3
Pipeline
#2476
passed with stages
in 2 minutes and 34 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
extension/Classes/Core/AbstractBuildForm.php
View file @
b73e7bcb
...
...
@@ -212,7 +212,7 @@ abstract class AbstractBuildForm {
* @throws \UserFormException
* @throws \UserReportException
*/
private
function
buildMultiForm
(
$filter
,
$modeCollectFe
,
array
$rcJson
)
{
private
function
buildMultiForm
(
$filter
,
$modeCollectFe
,
array
&
$rcJson
)
{
$htmlElements
=
''
;
$rcJson
=
array
();
...
...
@@ -234,10 +234,26 @@ abstract class AbstractBuildForm {
ERROR_INVALID_OR_MISSING_PARAMETER
);
}
// This is a dirty workaround for formSave: clear FORM STORE (already outdated values).
// Otherwise those outdated values will be taken to fill non primary FE in multiForm (which are garbage).
// Better solution would be to have FORM_STORE in sync.
$this
->
store
::
unsetStore
(
STORE_FORM
);
$storeVarBase
=
$this
->
evaluate
->
parse
(
$this
->
formSpec
[
FE_FILL_STORE_VAR
]);
if
(
!
is_array
(
$storeVarBase
))
{
$storeVarBase
=
array
();
}
// Per row, iterate over all form elements
foreach
(
$parentRecords
as
$row
)
{
// Always start with a clean STORE_VAR
$this
->
store
->
setStore
(
$storeVarBase
,
STORE_VAR
,
true
);
$this
->
store
->
setStore
(
$row
,
STORE_PARENT_RECORD
,
true
);
$this
->
store
->
setVar
(
F_MULTI_COL_ID
,
$row
[
$idName
],
STORE_PARENT_RECORD
);
// In case '_id' is used, both '_id' and 'id' should be accessible.
$record
=
$this
->
dbArray
[
$this
->
dbIndexData
]
->
sql
(
'SELECT * FROM `'
.
$this
->
formSpec
[
F_TABLE_NAME
]
.
'` WHERE id='
.
$row
[
F_MULTI_COL_ID
],
ROW_EXPECT_1
);
$this
->
store
->
setStore
(
$record
,
STORE_RECORD
,
true
);
$jsonTmp
=
array
();
$feTmp
=
$this
->
feSpecNative
;
...
...
@@ -252,7 +268,7 @@ abstract class AbstractBuildForm {
$this
->
feSpecNative
=
$feTmp
;
$this
->
store
::
unsetStore
(
STORE_RECORD
);
$rcJson
[]
=
$jsonTmp
;
$rcJson
=
array_merge
(
$rcJson
,
$jsonTmp
)
;
}
$tableHead
=
Support
::
wrapTag
(
'<tr>'
,
$this
->
buildMultiFormTableHead
(
$parentRecords
[
0
]));
...
...
@@ -386,7 +402,7 @@ abstract class AbstractBuildForm {
}
else
{
// Multi Form
if
(
$mode
===
FORM_LOAD
)
{
if
(
$mode
===
FORM_LOAD
||
$mode
===
FORM_SAVE
)
{
$htmlElements
=
$this
->
buildMultiForm
(
$filter
,
$modeCollectFe
,
$json
);
}
}
...
...
extension/Classes/Core/QuickFormQuery.php
View file @
b73e7bcb
...
...
@@ -340,6 +340,7 @@ class QuickFormQuery {
$foundInStore
=
''
;
$flagApiStructureReGroup
=
true
;
$formModeNew
=
''
;
$build
=
null
;
$recordId
=
$this
->
store
->
getVar
(
SIP_RECORD_ID
,
STORE_SIP
.
STORE_TYPO3
.
STORE_CLIENT
.
STORE_ZERO
);
$this
->
setParameterLanguageFieldName
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment