flux
flux copied to clipboard
Delete content element not working if it is hidden
TYPO3 11.5.5 flux: dev-development
When I try to delete a hidden content element, I have the following error:

The problem comes from this file:
Classes/Integration/HookSubscribers/DataHandlerSubscriber.php
To solve the problem, you could implement the following adjustments:
protected function getSingleRecordWithRestrictions(string $table, int $uid, string $fieldsToSelect): ?array
{
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable($table);
$queryBuilder->select(...GeneralUtility::trimExplode(',', $fieldsToSelect))
->from($table)
->where($queryBuilder->expr()->eq('uid', $queryBuilder->createNamedParameter($uid, \PDO::PARAM_INT)));
return $queryBuilder->execute()->fetch() ?: [];
}
protected function getSingleRecordWithoutRestrictions(string $table, int $uid, string $fieldsToSelect): ?array
{
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable($table);
$queryBuilder->getRestrictions()->removeAll();
$queryBuilder->select(...GeneralUtility::trimExplode(',', $fieldsToSelect))
->from($table)
->where($queryBuilder->expr()->eq('uid', $queryBuilder->createNamedParameter($uid, \PDO::PARAM_INT)));
return $queryBuilder->execute()->fetch() ?: [];
}
Hi there Sorry for rehandle this issue. I use TYPO3 V10.4.28 with Flux V9.6.1. If I remove or delete a hidden flux content element I still got following error:
Argument 1 passed to FluidTYPO3\Flux\Provider\AbstractProvider::getGrid() must be of the type array, null given, called in /home/webtecha/www/webtech.ch/typo3104/public/typo3conf/ext/flux/Classes/Integration/HookSubscribers/DataHandlerSubscriber.php on line 433
If I activate that content element and then remove or delete it, it does work. Could you please recheck it and search for a fix? Thanks in advance for your effort.
This bug has been caused by #1896 and is present since flux version 9.6.0.
@peterreichenbach correctly wrote there:
it is not possible anymore to do anything with restricted (hidden, starttime, endtime, fe_group) content elements. restriction in getSingleRecordWithRestrictions should be only "deleted".
@cweiske Thank you for taking your time to find a properly solution.
@cweiske Thanks for your patch, it works just fine now.
Up, any news on this topic. We also face the issue on one of our websites.
I'm having the same issue, running Flux 9.6.1 on TYPO3 11.5.16.