Deprecation: #109029 - FormEngine doSave hidden field
See forge#109029
Description
The
<input type="hidden" name="do field in FormEngine was a
legacy mechanism where JavaScript set the field value to
1 in order to
signal PHP that the submitted form data should be processed as a save operation.
This indirection is no longer needed. TYPO3 now uses native submit button values
such as
_savedok directly, which are sufficient to determine whether a
save should be performed. The field is no longer evaluated internally.
For backwards compatibility the
do field is still appended to the
form on programmatic saves in TYPO3 v14, but this behaviour is deprecated and
will be removed in TYPO3 v15.
Impact
Third-party code reading
$request->get to detect
whether a save operation was triggered will stop working in TYPO3 v15.
Affected Installations
Installations with custom backend modules or extensions that inspect the
do POST field to determine whether incoming form data should be
persisted.
Migration
Replace any check against the
do POST field with a check against
the native submit action fields that FormEngine sends as part of its regular
form submission.
Before:
$parsedBody = $request->getParsedBody();
$doSave = (bool)($parsedBody['doSave'] ?? false);
if ($doSave) {
// process data
}
After:
$parsedBody = $request->getParsedBody();
$isSaveAction = !empty($parsedBody['_savedok'])
|| !empty($parsedBody['_saveandclosedok'])
|| !empty($parsedBody['_savedokview'])
|| !empty($parsedBody['_savedoknew']);
if ($isSaveAction) {
// process data
}