Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
typo3
qfq
Commits
09235ef9
Commit
09235ef9
authored
Nov 28, 2019
by
Carsten Rose
Browse files
Temporary workaround to fix 'checkbox save'. Problem: no 'unchecked' values!!! TG not tested.
parent
25447b34
Changes
2
Hide whitespace changes
Inline
Side-by-side
extension/Classes/Core/Helper/HelperFormElement.php
View file @
09235ef9
...
...
@@ -213,11 +213,10 @@ class HelperFormElement {
public
static
function
prependFormElementNameCheckBoxMulti
(
$field
,
$index
,
$appendArray
=
false
)
{
// return '_' . $index . '_' . $field;
$key
=
'_'
.
$field
;
if
(
$appendArray
)
{
$key
.
=
'[]'
;
return
$field
.
'[]'
;
}
return
$
key
;
return
$
field
;
}
/**
...
...
extension/Classes/Core/Store/FillStoreForm.php
View file @
09235ef9
...
...
@@ -257,7 +257,7 @@ class FillStoreForm {
switch
(
$formElement
[
FE_TYPE
])
{
case
FE_TYPE_CHECKBOX
:
// Checkbox Multi: collect values
$val
=
$this
->
collect
Multi
Values
(
$clientFieldName
,
$clientValues
);
$val
=
$this
->
collect
CheckBox
Values
(
$clientFieldName
,
$clientValues
);
if
(
$val
!==
false
)
{
$clientValues
[
$clientFieldName
]
=
$val
;
}
...
...
@@ -352,21 +352,23 @@ class FillStoreForm {
*
* @return string
*/
private
function
collect
Multi
Values
(
$clientFieldName
,
array
$clientValues
)
{
private
function
collect
CheckBox
Values
(
$clientFieldName
,
array
$clientValues
)
{
$checkboxKey
=
HelperFormElement
::
prependFormElementNameCheckBoxMulti
(
$clientFieldName
,
''
,
false
);
// Check for Single
// $checkboxKey = HelperFormElement::prependFormElementNameCheckBoxMulti($clientFieldName, '', false);
if
(
!
isset
(
$clientValues
[
$checkboxKey
]))
{
return
''
;
}
if
(
isset
(
$clientValues
[
$clientFieldName
]))
{
// single: no array, multi: array
if
(
!
is_array
(
$clientValues
[
$checkboxKey
]))
{
return
false
;
if
(
is_array
(
$clientValues
[
$clientFieldName
]))
{
return
implode
(
','
,
$clientValues
[
$clientFieldName
]);
}
return
$clientValues
[
$clientFieldName
];
}
return
false
;
return
implode
(
','
,
$clientValues
[
$checkboxKey
]);
// For templateGroups: all expanded FormElements will be tried to collect - this fails for not submitted fields.
// Therefore skip not existing clientvalues.
...
...
Write
Preview
Supports
Markdown
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