#72850foreach error in DatabaseTreeDataProvider
Description
The foreach loop in /typo3_src-7.6.2/typo3/sysext/core/Classes/Tree/TableConfiguration/DatabaseTreeDataProvider.php raises a PHP error when no record has been found.
Add the check if not empty.
protected function listFieldQuery($fieldName, $queryId)
{
$records = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('uid', $this->getTableName(), $GLOBALS['TYPO3_DB']->listQuery($fieldName, (int)$queryId, $this->getTableName()) . ((int)$queryId === 0 ? ' OR CAST(' . $fieldName . ' AS CHAR) = \'\'' : ''));
$uidArray = array();
if (!empty($records)) {
foreach ($records as $record) {
$uidArray[] = $record['uid'];
}
}
return $uidArray;
}