[BUGFIX] Fix sql query selecting invalid field 97/50097/4
authorSascha Egerer <sascha@sascha-egerer.de>
Fri, 7 Oct 2016 08:17:36 +0000 (10:17 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Fri, 7 Oct 2016 09:42:22 +0000 (11:42 +0200)
In #77488 the ExtendedFileUtility has been refactored to doctrine.
This has introduced a bug where an invalid field is selected from the
database.

Resolves: #78163
Related: #77488
Releases: master
Change-Id: I926cd4bc04c59b50f3cb9973f5005ec97e788648
Reviewed-on: https://review.typo3.org/50097
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Frederic Gaus <frederic.gaus@flagbit.de>
Reviewed-by: Martin Fox <kontakt@mlis.pl>
Tested-by: Martin Fox <kontakt@mlis.pl>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/core/Classes/Utility/File/ExtendedFileUtility.php

index c22952a..11c7044 100644 (file)
@@ -576,7 +576,7 @@ class ExtendedFileUtility extends BasicFileUtility
         $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('sys_refindex');
         $queryBuilder->getRestrictions()->removeAll();
         $fileReference = $queryBuilder
-            ->select('recuid', 'uid_foreign', 'tablenames', 'fieldname', 'sorting_foreign')
+            ->select('uid_foreign', 'tablenames', 'fieldname', 'sorting_foreign')
             ->from('sys_file_reference')
             ->where(
                 $queryBuilder->expr()->eq('uid', (int)$referenceRecord['recuid'])