Project

General

Profile

Actions

Bug #93549

closed

DataHandler unusable in CLI (Symfony) mode because FlashMessages using session data

Added by Stefan P about 3 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
DataHandler aka TCEmain
Target version:
-
Start date:
2021-02-19
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

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


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #86877: refindex:update does not work in CLI-ContextClosed2018-11-07

Actions
Actions #1

Updated by Stefan P about 3 years ago

  • Related to Bug #86877: refindex:update does not work in CLI-Context added
Actions #2

Updated by Stefan P about 3 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

Actions #3

Updated by Christian Weiske about 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.

Actions #4

Updated by Gerrit Code Review about 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

Actions #5

Updated by Christian Weiske about 3 years ago

The patch works for v10 as well.

In v11, everything is different and the patch does not apply anymore.

Actions #6

Updated by Gerrit Code Review almost 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

Actions #7

Updated by Benni Mack almost 3 years ago

Can you check my approach (which should work for master)?

Actions #8

Updated by Gerrit Code Review almost 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

Actions #9

Updated by Gerrit Code Review almost 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

Actions #10

Updated by Gerrit Code Review almost 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

Actions #11

Updated by Benni Mack almost 3 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #12

Updated by Gerrit Code Review almost 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

Actions #13

Updated by Gerrit Code Review almost 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

Actions #14

Updated by Benni Mack almost 3 years ago

  • Status changed from Under Review to Resolved
Actions #15

Updated by Benni Mack over 2 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF