Skip to content
GitLab
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
f19f3272
Commit
f19f3272
authored
Apr 20, 2021
by
Carsten Rose
Browse files
Merge remote-tracking branch 'origin/develop' into develop
parents
cb931e3b
c24c9d9f
Pipeline
#5161
passed with stages
in 5 minutes and 47 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
extension/Classes/Core/Save.php
View file @
f19f3272
...
...
@@ -750,13 +750,32 @@ class Save {
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.
continue
;
}
// Upload needs special action to check for empty.
if
(
$mode
==
FE_MODE_REQUIRED
&&
$formElement
[
FE_TYPE
]
==
FE_TYPE_UPLOAD
)
{
// Get new upload state
$statusUpload
=
$this
->
store
->
getVar
(
$clientValues
[
$formElement
[
FE_NAME
]]
??
''
,
STORE_EXTRA
);
// Check if there is a new upload
if
(
$statusUpload
[
FILES_TMP_NAME
]
!=
''
)
{
continue
;
// Upload given: continue with next FE
}
// Check if there is no already given upload or such upload has not to be deleted
if
(
empty
(
$this
->
store
->
getVar
(
$formElement
[
FE_NAME
],
STORE_RECORD
))
||
(
$statusUpload
[
FILES_FLAG_DELETE
]
??
0
)
==
'1'
)
{
// Fake to trigger the next if( .. empty...)
$clientValues
[
$formElement
[
FE_NAME
]]
=
''
;
}
}
if
(
$mode
==
FE_MODE_REQUIRED
&&
empty
(
$clientValues
[
$formElement
[
FE_NAME
]]))
{
$flagAllRequiredGiven
=
0
;
if
(
$reportRequiredFailed
)
{
throw
new
\
UserFormException
(
"Missing required value: "
.
$formElement
[
FE_LABEL
],
ERROR_REQUIRED_VALUE_EMPTY
);
$name
=
(
$formElement
[
FE_LABEL
]
==
''
)
?
$formElement
[
FE_NAME
]
:
$formElement
[
FE_LABEL
];
throw
new
\
UserFormException
(
"Missing required value:
$name
"
,
ERROR_REQUIRED_VALUE_EMPTY
);
}
}
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment