Bug #93549
closedDataHandler unusable in CLI (Symfony) mode because FlashMessages using session data
100%
Description
Using the DataHandler in CLI mode does not reliably work because on some validation errors it generates FlashMessages with $storeInSession = true
, an example being checkValue_input_ValidateEmail()
(called by 'eval' => 'email'
). The CLI has no session, even when \TYPO3\CMS\Core\Core\Bootstrap::initializeBackendAuthentication();
was called.
So the DataHandler in CLI only works if the input data is fully pre-sanitized, defeating the main purpose of using the DataHandler at all.
Discovered in v9, probably valid for v10+ as well.
See also #86877
Updated by S P almost 4 years ago
- Related to Bug #86877: refindex:update does not work in CLI-Context added
Updated by S P almost 4 years ago
The exception then thrown is this:
Uncaught TYPO3 Exception Argument 1 passed to TYPO3\CMS\Core\Session\Backend\DatabaseSessionBackend::update() must be of the type string, null given, called in /typo3/sysext/core/Classes/Authentication/AbstractUserAuthentication.php on line 1323
Updated by Christian Weiske over 3 years ago
We hook into DataHandler to do geocoding of addresses when records are saved. Errors and success information are shown via flash messages.
Doing the same in batch mode from CLI is broken with TYPO3 v9 because of this problem here.
Our CLI script manually prints the queued flash messages to stdout.
Updated by Gerrit Code Review over 3 years ago
- Status changed from New to Under Review
Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/68178
Updated by Christian Weiske over 3 years ago
The patch works for v10 as well.
In v11, everything is different and the patch does not apply anymore.
Updated by Gerrit Code Review over 3 years ago
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/68921
Updated by Benni Mack over 3 years ago
Can you check my approach (which should work for master)?
Updated by Gerrit Code Review over 3 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/68921
Updated by Gerrit Code Review over 3 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/68921
Updated by Gerrit Code Review over 3 years ago
Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/68921
Updated by Benni Mack over 3 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset e190d9f87c9d140429b35afea6b067ad24decf3f.
Updated by Gerrit Code Review over 3 years ago
- Status changed from Resolved to Under Review
Patch set 1 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/69052
Updated by Gerrit Code Review over 3 years ago
Patch set 2 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/69052
Updated by Benni Mack over 3 years ago
- Status changed from Under Review to Resolved
Applied in changeset d36ca4cae1243e582d16d651a35d15848a7c3737.