powermail icon indicating copy to clipboard operation
powermail copied to clipboard

Can't submit any form in TYPO3 11.5.16

Open timdreier opened this issue 2 years ago • 3 comments

Hi, after an update to TYPO3 11.5.16 I can't submit any form anymore. I debugged the error until the FieldRepository. Here, something strange happens:

$query->execute()->getFirst()

Returns NULL. If I debug the Query, it is valid and gives the correct result in phpMyAdmin. Even debugging with

$query->execute()->count()

shows one result (or n, if all constraint are removed from the query). However, ->getFirst() and ->toArray return NULL / [].

timdreier avatar Oct 10 '22 10:10 timdreier

Hi, did you check https://github.com/einpraegsam/powermail/blob/develop/Documentation/Changelog/UpgradeInstructions.md after powermail update?

einpraegsam avatar Oct 10 '22 12:10 einpraegsam

@einpraegsam yes, after some more debugging I found out that the problem only occurs on translated forms. But it's strange anyway what happens in the repo. If I generate the query like this I get the correct result:

/** @var \TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser $queryParser */
$objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\ObjectManager::class);
$queryParser = $objectManager->get(\TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser::class);
$sql = $queryParser->convertQueryToDoctrineQueryBuilder($query)->getSQL();
$params = $queryParser->convertQueryToDoctrineQueryBuilder($query)->getParameters();
foreach (array_reverse($params) as $key => $value) {
    if (is_array($value)) {
        $value = implode(',', array_map(fn($str) => "'$str'", $value));
    } else {
        $value = "'$value'";
    }
    $sql = str_replace(':' . $key, $value, $sql);
}

count() -> 1; executing the query in phpMyAdmin -> 1

However the repo delivers Null with $query->execute()->getFirst().

timdreier avatar Oct 10 '22 13:10 timdreier

Sorry, but I'm not sure what to do with the information. What should I exactly do to reproduce the issue?

einpraegsam avatar Oct 11 '22 08:10 einpraegsam

@einpraegsam the problem apparently already existed in version 10 in my project, only nobody noticed it there.

It seems to be related to when a form is translated. However, I haven't had time to investigate this further. Since it could also be a configuration error, I'm closing this topic.

timdreier avatar Nov 10 '22 14:11 timdreier

Thx for the final feedback

einpraegsam avatar Nov 10 '22 14:11 einpraegsam