[BUGFIX] Simplify some FormEngine validations
This patch simplifies some JavaScript-side validations in FormEngine. Most notably, parsing dates and times is now handled by moment.js (which will be replaced by luxon in the future), allowing us to remove decades-old mambo-jambo code nobody can reverse-engineer nowadays. In the same run, `ltrim()` and the unused `btrim()` methods are removed in favor of modern JavaScript functions. Previously, it was possible to supply the invalid date "13-13-2016" which was magically fixed to "13-01-2017". However, this was only possible by setting the value and triggering the `change` event via JavaScript and NOT by using the backend as a sane user. The behavior introduced with this patch is now streamlined to behave like using the datepicker or entering the field in the input field. Resolves: #99058 Releases: main Change-Id: I98af867ee3bda91222d21bcee1bc1f4c92e41d7e Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/76544 Tested-by:core-ci <typo3@b13.com> Te...
Showing
- Build/Sources/TypeScript/backend/form-engine-validation.ts 10 additions, 166 deletionsBuild/Sources/TypeScript/backend/form-engine-validation.ts
- Build/Sources/TypeScript/backend/tests/form-engine-validation-test.ts 0 additions, 45 deletions...s/TypeScript/backend/tests/form-engine-validation-test.ts
- typo3/sysext/backend/Resources/Public/JavaScript/form-engine-validation.js 1 addition, 1 deletion...end/Resources/Public/JavaScript/form-engine-validation.js
- typo3/sysext/backend/Tests/JavaScript/form-engine-validation-test.js 1 addition, 1 deletion...t/backend/Tests/JavaScript/form-engine-validation-test.js
- typo3/sysext/core/Tests/Acceptance/Application/FormEngine/ElementsBasicInputDateCest.php 0 additions, 8 deletions...nce/Application/FormEngine/ElementsBasicInputDateCest.php
Please register or sign in to comment