[BUGFIX] Fix usage of non existing field in count query 50/49850/3
authorSascha Egerer <sascha@sascha-egerer.de>
Sat, 3 Sep 2016 16:54:42 +0000 (18:54 +0200)
committerSascha Egerer <sascha@sascha-egerer.de>
Sat, 3 Sep 2016 17:49:50 +0000 (19:49 +0200)
In a cound query the field uid is used on the sys_fileref table.
But this table does not have a uid field.

Resolves: #77837
Releases: master
Change-Id: I6609cb4126162131d478a481cb55fe0b540d34fa
Reviewed-on: https://review.typo3.org/49850
Tested-by: Bamboo TYPO3com <info@typo3.com>
Reviewed-by: Kay Strobach <typo3@kay-strobach.de>
Tested-by: Kay Strobach <typo3@kay-strobach.de>
Reviewed-by: Sascha Egerer <sascha@sascha-egerer.de>
Tested-by: Sascha Egerer <sascha@sascha-egerer.de>
typo3/sysext/core/Classes/Utility/File/ExtendedFileUtility.php

index f97bbe9..c22952a 100644 (file)
@@ -540,7 +540,7 @@ class ExtendedFileUtility extends BasicFileUtility
         $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('sys_refindex');
         $queryBuilder->getRestrictions()->removeAll()->add(GeneralUtility::makeInstance(DeletedRestriction::class));
         $numberOfReferences = $queryBuilder
-            ->count('uid')
+            ->count('hash')
             ->from('sys_refindex')
             ->where(
                 $queryBuilder->expr()->eq('ref_table', $queryBuilder->createNamedParameter('sys_file')),