Deprecation: #103528 - Deprecated DocumentSaveActions
module
See forge#103528
Description
The JavaScript module
@typo3/
was
introduced in TYPO3 v7 to add some interactivity in FormEngine context.
At first it was only used to disable the submit button and render a
spinner icon instead. Over the course of some years, the module got more
functionality, for example to prevent saving when validation fails.
Since some refactorings within FormEngine, the module rather became a
burden. This became visible with the introduction of the
Hotkeys API, as
the
@typo3/
reacts on explicit
click
events on the save icon, that is not triggered when FormEngine invokes a
save action via keyboard shortcuts.
Adjusting
document-
's
behavior is necessary, but would become a breaking change, which is
unacceptable after the 13.0 release. For this reason, said module has
been marked as deprecated and its usages are replaced by its successor
@typo3/
.
Impact
Using the JavaScript module
@typo3/
will
render a deprecation warning in the browser's console.
Affected installations
All installations relying on
@typo3/
are
affected.
Migration
To migrate the interception of submit events, the successor module
@typo3/
shall be used instead.
The usage is similar to
@typo3/
, but
requires the form HTML element in its constructor.
Example
import '@typo3/backend/form/submit-interceptor.js';
// ...
const formElement = document.querySelector('form');
const submitInterceptor = new SubmitInterceptor(formElement);
submitInterceptor.addPreSubmitCallback(function() {
// the same handling as in @typo3/backend/document-save-actions.js
});