powermail
powermail copied to clipboard
Can't submit any form in TYPO3 11.5.16
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 / [].
Hi, did you check https://github.com/einpraegsam/powermail/blob/develop/Documentation/Changelog/UpgradeInstructions.md after powermail update?
@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()
.
Sorry, but I'm not sure what to do with the information. What should I exactly do to reproduce the issue?
@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.
Thx for the final feedback