Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
qfq
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
typo3
qfq
Commits
8dfadeca
Commit
8dfadeca
authored
8 years ago
by
Carsten Rose
Browse files
Options
Downloads
Patches
Plain Diff
FillStoreForm.php, Constants.php: fixed bug that empty values are not stored.
parent
2d0d6fc3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
extension/qfq/qfq/Constants.php
+1
-0
1 addition, 0 deletions
extension/qfq/qfq/Constants.php
extension/qfq/qfq/store/FillStoreForm.php
+11
-15
11 additions, 15 deletions
extension/qfq/qfq/store/FillStoreForm.php
with
12 additions
and
15 deletions
extension/qfq/qfq/Constants.php
+
1
−
0
View file @
8dfadeca
...
...
@@ -129,6 +129,7 @@ const ERROR_UNKNOWN_SQL_LOG_MODE = 1051;
const
ERROR_FORM_NOT_FOUND
=
1052
;
const
ERROR_DATE_TIME_FORMAT_NOT_RECOGNISED
=
1053
;
const
ERROR_SANATIZE_INVALID_VALUE
=
1054
;
const
ERROR_REQUIRED_VALUE_EMPTY
=
1055
;
// Store
const
ERROR_STORE_VALUE_ALREADY_CODPIED
=
1100
;
...
...
This diff is collapsed.
Click to expand it.
extension/qfq/qfq/store/FillStoreForm.php
+
11
−
15
View file @
8dfadeca
...
...
@@ -106,12 +106,18 @@ class FillStoreForm {
continue
;
}
if
(
$formElement
[
'mode'
]
===
FE_MODE_REQUIRED
)
{
if
(
!
isset
(
$clientValues
[
$clientFieldName
])
||
(
$clientValues
[
$clientFieldName
]
===
''
))
{
throw
new
UserFormException
(
"Missing required value."
,
ERROR_REQUIRED_VALUE_EMPTY
);
}
}
switch
(
$formElement
[
'mode'
])
{
case
FE_MODE_SHOW
:
case
FE_MODE_REQUIRED
:
if
(
isset
(
$clientValues
[
$clientFieldName
])
&&
(
$clientValues
[
$clientFieldName
]
!=
''
))
{
case
FE_MODE_SHOW
:
if
(
isset
(
$clientValues
[
$clientFieldName
]))
{
// SELECT
with multiple values, or Multi
CHECKBOX
are
delivered as array
:
implode them
// SELECT
MULTI or
CHECKBOX
MULTI:
delivered as array
-
implode them
.
if
(
is_array
(
$clientValues
[
$clientFieldName
]))
{
// E.g. Checkboxes needs a 'HIDDEN' HTML input to detect 'unset' of values. These 'HIDDEN' element
// needs to be removed, if there is at least one checkbox is checked (=submitted)
...
...
@@ -121,18 +127,8 @@ class FillStoreForm {
$clientValues
[
$clientFieldName
]
=
implode
(
','
,
$clientValues
[
$clientFieldName
]);
}
// try {
$newValues
[
$formElement
[
'name'
]]
=
Sanitize
::
sanitize
(
$clientValues
[
$clientFieldName
],
$formElement
[
'checkType'
],
$formElement
[
'checkPattern'
],
SANATIZE_EXCEPTION
);
// } catch (UserFormException $e) {
// $msg = "Form element '" . $formElement['name'] . ' / ' . $formElement['label'] . "': " . $e->formatMessage();
// throw new UserFormException($msg, ERROR_SANATIZE_INVALID_VALUE);
// }
}
else
{
if
(
$formElement
[
'mode'
]
===
FE_MODE_REQUIRED
)
{
throw
new
UserFormException
(
"Missing required value for '"
.
$formElement
[
'name'
]
.
' / '
.
$formElement
[
'label'
]
.
"'"
,
ERROR_UNKNOWN_MODE
);
}
$newValues
[
$formElement
[
'name'
]]
=
Sanitize
::
sanitize
(
$clientValues
[
$clientFieldName
],
$formElement
[
'checkType'
],
$formElement
[
'checkPattern'
],
SANATIZE_EXCEPTION
);
}
break
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment