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
c8fed1ac
Commit
c8fed1ac
authored
Aug 28, 2018
by
Carsten Rose
Browse files
F6563 Accept 0 as required. implemented
parent
1977a980
Pipeline
#791
passed with stage
in 1 minute and 35 seconds
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
extension/Documentation/Manual.rst
View file @
c8fed1ac
...
...
@@ -2737,11 +2737,13 @@ See also at specific *FormElement* definitions.
| unchecked | string | |
| label2 | string | |
| itemList | string | |
| emptyHide |
string
| |
| emptyItemAtStart |
string
| |
| emptyItemAtEnd |
string
| |
| emptyHide |
-
| |
| emptyItemAtStart |
-
| |
| emptyItemAtEnd |
-
| |
| buttonClass | string | |
+------------------------+--------+----------------------------------------------------------------------------------------------------------+
| acceptZeroAsRequired | string | 0|1 - Accept a '0' as a valid input. Default '0' (=0 is not a valid input) |
+------------------------+--------+----------------------------------------------------------------------------------------------------------+
| dateFormat | string | yyyy-mm-dd | dd.mm.yyyy |
+------------------------+--------+----------------------------------------------------------------------------------------------------------+
| decimalFormat | string | [precision,scale] Limits and formats input to a decimal number with the specified precision and scale. |
...
...
extension/qfq/qfq/Constants.php
View file @
c8fed1ac
...
...
@@ -1049,6 +1049,7 @@ const FE_FILE_BUTTON_TEXT = 'fileButtonText';
const
FE_FILE_BUTTON_TEXT_DEFAULT
=
'Choose File'
;
const
FE_INPUT_TYPE
=
'inputType'
;
const
FE_STEP
=
'step'
;
const
FE_ACCEPT_ZERO_AS_REQUIRED
=
'acceptZeroAsRequired'
;
const
FE_IMAGE_CUT_RESIZE_WIDTH
=
'resizeWidth'
;
const
FE_IMAGE_CUT_KEEP_ORIGINAL
=
'keepOriginal'
;
...
...
extension/qfq/qfq/Save.php
View file @
c8fed1ac
...
...
@@ -439,6 +439,11 @@ class Save {
$this
->
feSpecNative
[
$key
][
FE_MODE_SQL
]
=
$mode
;
}
if
(
isset
(
$formElement
[
FE_ACCEPT_ZERO_AS_REQUIRED
])
&&
$formElement
[
FE_ACCEPT_ZERO_AS_REQUIRED
]
!=
'0'
&&
isset
(
$clientValues
[
$formElement
[
FE_NAME
]])
&&
$clientValues
[
$formElement
[
FE_NAME
]]
==
'0'
){
$mode
=
'fake'
;
// The next if() should never be true.
}
if
(
!
$requiredOff
&&
$mode
==
FE_MODE_REQUIRED
&&
empty
(
$clientValues
[
$formElement
[
FE_NAME
]]))
{
throw
new
UserFormException
(
"Missing required value: "
.
$formElement
[
FE_LABEL
],
ERROR_REQUIRED_VALUE_EMPTY
);
}
...
...
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