diff --git a/CHANGELOG.md b/CHANGELOG.md index a35dc09..a36bb10 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ All notable changes to this project will be documented in this file. +## [1.15.10] - 2022-09-06 +- Fixed: General::getFields() inputType filter returned wrong values + ## [1.15.9] - 2022-08-23 - Fixed: warnings in php 8 diff --git a/library/Haste/Dca/General.php b/library/Haste/Dca/General.php index 2b4e98e..2366dd6 100644 --- a/library/Haste/Dca/General.php +++ b/library/Haste/Dca/General.php @@ -537,6 +537,14 @@ public static function getFields( $arrOptions = []; + $evaluateInputType = false; + if (!empty($varInputType)) { + if (is_string($varInputType)) { + $varInputType = [$varInputType]; + } + $evaluateInputType = true; + } + foreach ($GLOBALS['TL_DCA'][$strTable]['fields'] as $strField => $arrData) { // skip special fields if (in_array($strField, $arrSkipFields)) { @@ -544,12 +552,8 @@ public static function getFields( } // input type - if (!empty($varInputType)) { - if ( - empty($arrData['inputType']) - || (is_array($varInputType) && in_array($arrData['inputType'], $varInputType)) - || (is_string($varInputType) && ($arrData['inputType'] != $varInputType)) - ) { + if ($evaluateInputType) { + if (empty($arrData['inputType']) || !in_array($arrData['inputType'], $varInputType)) { continue; } }