296,373c296,363 < $fC = $GLOBALS['TCA'][$this->table]['columns'][$fieldName]; < $this->fields[$fieldName] = $fC['config']; < $this->fields[$fieldName]['exclude'] = $fC['exclude']; < if ($this->fields[$fieldName]['type'] === 'user' && !isset($this->fields[$fieldName]['type']['userFunc']) < || $this->fields[$fieldName]['type'] === 'none' < ) { < // Do not list type=none "virtual" fields or query them from db, < // and if type is user without defined userFunc < unset($this->fields[$fieldName]); < continue; < } < if (is_array($fC) && $fC['label']) { < $this->fields[$fieldName]['label'] = rtrim(trim($this->getLanguageService()->sL($fC['label'])), ':'); < switch ($this->fields[$fieldName]['type']) { < case 'input': < if (preg_match('/int|year/i', $this->fields[$fieldName]['eval'])) { < $this->fields[$fieldName]['type'] = 'number'; < } elseif (preg_match('/time/i', $this->fields[$fieldName]['eval'])) { < $this->fields[$fieldName]['type'] = 'time'; < } elseif (preg_match('/date/i', $this->fields[$fieldName]['eval'])) { < $this->fields[$fieldName]['type'] = 'date'; < } else { < $this->fields[$fieldName]['type'] = 'text'; < } < break; < case 'check': < if (!$this->fields[$fieldName]['items'] || count($this->fields[$fieldName]['items']) <= 1) { < $this->fields[$fieldName]['type'] = 'boolean'; < } else { < $this->fields[$fieldName]['type'] = 'binary'; < } < break; < case 'radio': < $this->fields[$fieldName]['type'] = 'multiple'; < break; < case 'select': < case 'category': < $this->fields[$fieldName]['type'] = 'multiple'; < if ($this->fields[$fieldName]['foreign_table']) { < $this->fields[$fieldName]['type'] = 'relation'; < } < if ($this->fields[$fieldName]['special']) { < $this->fields[$fieldName]['type'] = 'text'; < } < break; < case 'group': < if (($this->fields[$fieldName]['internal_type'] ?? '') !== 'folder') { < $this->fields[$fieldName]['type'] = 'relation'; < } < break; < case 'user': < case 'flex': < case 'passthrough': < case 'none': < case 'text': < default: < $this->fields[$fieldName]['type'] = 'text'; < } < } else { < $this->fields[$fieldName]['label'] = '[FIELD: ' . $fieldName . ']'; < switch ($fieldName) { < case 'pid': < $this->fields[$fieldName]['type'] = 'relation'; < $this->fields[$fieldName]['allowed'] = 'pages'; < break; < case 'cruser_id': < $this->fields[$fieldName]['type'] = 'relation'; < $this->fields[$fieldName]['allowed'] = 'be_users'; < break; < case 'tstamp': < case 'crdate': < $this->fields[$fieldName]['type'] = 'time'; < break; < case 'deleted': < $this->fields[$fieldName]['type'] = 'boolean'; < break; < default: < $this->fields[$fieldName]['type'] = 'number'; --- > isset($GLOBALS['TCA'][$this->table]['columns'][$fieldName]) ? $fC = $GLOBALS['TCA'][$this->table]['columns'][$fieldName] : $fC = null; > > $this->fields[$fieldName]['type'] = nulL; > if ($fC){ > $this->fields[$fieldName] = $fC['config']; > $this->fields[$fieldName]['exclude'] = isset($fC['exclude']) ? $fC['exclude'] : ''; > if ($this->fields[$fieldName]['type'] === 'user' && !isset($this->fields[$fieldName]['type']['userFunc']) > || $this->fields[$fieldName]['type'] === 'none' > ) { > // Do not list type=none "virtual" fields or query them from db, > // and if type is user without defined userFunc > unset($this->fields[$fieldName]); > continue; > } > > if (is_array($fC) && isset($fC['label'])) { > $this->fields[$fieldName]['label'] = rtrim(trim($this->getLanguageService()->sL($fC['label'])), ':'); > if (!isset($this->fields[$fieldName]['eval'])){ > $this->fields[$fieldName]['eval'] = ''; > } > switch ($this->fields[$fieldName]['type']) { > case 'input': > if (preg_match('/int|year/i', $this->fields[$fieldName]['eval'])) { > $this->fields[$fieldName]['type'] = 'number'; > } elseif (preg_match('/time/i', $this->fields[$fieldName]['eval'])) { > $this->fields[$fieldName]['type'] = 'time'; > } elseif (preg_match('/date/i', $this->fields[$fieldName]['eval'])) { > $this->fields[$fieldName]['type'] = 'date'; > } else { > $this->fields[$fieldName]['type'] = 'text'; > } > break; > case 'check': > if ( > (! isset($this->fields[$fieldName]['items'])) || > (isset($this->fields[$fieldName]['items']) && (!$this->fields[$fieldName]['items'] || count($this->fields[$fieldName]['items']) <= 1)) > ) { > $this->fields[$fieldName]['type'] = 'boolean'; > } else { > $this->fields[$fieldName]['type'] = 'binary'; > } > break; > case 'radio': > $this->fields[$fieldName]['type'] = 'multiple'; > break; > case 'select': > case 'category': > $this->fields[$fieldName]['type'] = 'multiple'; > if ($this->fields[$fieldName]['foreign_table']) { > $this->fields[$fieldName]['type'] = 'relation'; > } > if (isset($this->fields[$fieldName]['special'])) { > $this->fields[$fieldName]['type'] = 'text'; > } > break; > case 'group': > if (($this->fields[$fieldName]['internal_type'] ?? '') !== 'folder') { > $this->fields[$fieldName]['type'] = 'relation'; > } > break; > case 'user': > case 'flex': > case 'passthrough': > case 'none': > case 'text': > default: > $this->fields[$fieldName]['type'] = 'text'; > } 374a365,387 > > if (! $this->fields[$fieldName]['type']){ > $this->fields[$fieldName]['label'] = '[FIELD: ' . $fieldName . ']'; > switch ($fieldName) { > case 'pid': > $this->fields[$fieldName]['type'] = 'relation'; > $this->fields[$fieldName]['allowed'] = 'pages'; > break; > case 'cruser_id': > $this->fields[$fieldName]['type'] = 'relation'; > $this->fields[$fieldName]['allowed'] = 'be_users'; > break; > case 'tstamp': > case 'crdate': > $this->fields[$fieldName]['type'] = 'time'; > break; > case 'deleted': > $this->fields[$fieldName]['type'] = 'boolean'; > break; > default: > $this->fields[$fieldName]['type'] = 'number'; > } > } 375a389,390 > > //echo "$fieldName::" . $this->fields[$fieldName]['type'] . "
"; 445c460 < if ($POST['qG_del']) { --- > if (isset($POST['qG_del'])) { 461a477 > 463c479 < if ($POST['qG_ins']) { --- > if (isset($POST['qG_ins'])) { 480a497 > 482c499 < if ($POST['qG_up']) { --- > if (isset($POST['qG_up'])) { 495a513 > 497c515 < if ($POST['qG_nl']) { --- > if (isset($POST['qG_nl'])) { 519c537 < if ($POST['qG_remnl']) { --- > if (isset($POST['qG_remnl'])) { 567c585 < $fieldType = $this->fields[$fieldName]['type']; --- > $fieldType = isset($this->fields[$fieldName]['type']) ? $this->fields[$fieldName]['type'] : 'ignore'; 583a602 > break; 590c609 < $queryConfig[$key]['comparison'] = $this->verifyComparison($conf['comparison'], $conf['negate'] ? 1 : 0); --- > $queryConfig[$key]['comparison'] = $this->verifyComparison($conf['comparison'], isset($conf['negate']) ? 1 : 0); 623,624c642,643 < $fieldType = $this->fields[$fieldName]['type']; < if ($this->comp_offsets[$fieldType] != $conf['comparison'] >> 5) { --- > $fieldType = isset($this->fields[$fieldName]['type']) ? $this->fields[$fieldName]['type'] : 'ignore'; > if (isset($this->comp_offsets[$fieldType]) && $this->comp_offsets[$fieldType] != $conf['comparison'] >> 5) { 754a774,777 > > if (! isset($conf['negate'])){ > $conf['negate'] = ''; > } 807,818c830,843 < foreach ($fieldSetup['items'] as $key => $val) { < if (strpos($val[0], 'LLL:') === 0) { < $value = $languageService->sL($val[0]); < } else { < $value = $val[0]; < } < $itemVal = (string)(2 ** $key); < if (GeneralUtility::inList($conf['inputValue'], $itemVal)) { < $out[] = ''; < } else { < $out[] = ''; < } --- > if(isset($fieldSetup['items'])){ > foreach ($fieldSetup['items'] as $key => $val) { > if (strpos($val[0], 'LLL:') === 0) { > $value = $languageService->sL($val[0]); > } else { > $value = $val[0]; > } > $itemVal = (string)(2 ** $key); > if (GeneralUtility::inList($conf['inputValue'], $itemVal)) { > $out[] = ''; > } else { > $out[] = ''; > } > } 1014c1039 < if (is_array($v['sub'])) { --- > if (isset($v['sub']) && is_array($v['sub'])) { 1063a1089,1092 > if (!isset($value['exclude'])){ > $value['exclude'] = false; > } > 1065c1094 < $label = $this->fields[$key]['label']; --- > $label = isset($this->fields[$key]['label']) ? $this->fields[$key]['label'] : $name; 1178,1180c1207,1211 < if ($this->lang['comparison'][$i . '_']) { < $out[] = ''; < } --- > if (isset($this->lang['comparison'][$i . '_'])){ > if ($this->lang['comparison'][$i . '_']) { > $out[] = ''; > } > } 1368,1389c1399,1424 < if ($conf['comparison'] >> 5 === 0 || ($conf['comparison'] === 32 || $conf['comparison'] === 33 || $conf['comparison'] === 64 || $conf['comparison'] === 65 || $conf['comparison'] === 66 || $conf['comparison'] === 67 || $conf['comparison'] === 96 || $conf['comparison'] === 97)) { < $inputVal = $conf['inputValue' . $suffix]; < } elseif ($conf['comparison'] === 39 || $conf['comparison'] === 38) { < // in list: < $inputVal = implode(',', GeneralUtility::intExplode(',', $conf['inputValue' . $suffix])); < } elseif ($conf['comparison'] === 68 || $conf['comparison'] === 69 || $conf['comparison'] === 162 || $conf['comparison'] === 163) { < // in list: < if (is_array($conf['inputValue' . $suffix])) { < $inputVal = implode(',', $conf['inputValue' . $suffix]); < } elseif ($conf['inputValue' . $suffix]) { < $inputVal = $conf['inputValue' . $suffix]; < } else { < $inputVal = 0; < } < } elseif (!is_array($conf['inputValue' . $suffix]) && strtotime($conf['inputValue' . $suffix])) { < $inputVal = $conf['inputValue' . $suffix]; < } elseif (!is_array($conf['inputValue' . $suffix]) && MathUtility::canBeInterpretedAsInteger($conf['inputValue' . $suffix])) { < $inputVal = (int)$conf['inputValue' . $suffix]; < } else { < // TODO: Six eyes looked at this code and nobody understood completely what is going on here and why we < // fallback to float casting, the whole class smells like it needs a refactoring. < $inputVal = (float)$conf['inputValue' . $suffix]; --- > $inputVal = null; > if (isset($conf['inputValue' . $suffix])){ > if ($conf['comparison'] >> 5 === 0 || ($conf['comparison'] === 32 || $conf['comparison'] === 33 || $conf['comparison'] === 64 || $conf['comparison'] === 65 || $conf['comparison'] === 66 || $conf['comparison'] === 67 || $conf['comparison'] === 96 || $conf['comparison'] === 97)) { > $inputVal = $conf['inputValue' . $suffix]; > } elseif ($conf['comparison'] === 39 || $conf['comparison'] === 38) { > // in list: > $inputVal = implode(',', GeneralUtility::intExplode(',', $conf['inputValue' . $suffix])); > } elseif ($conf['comparison'] === 68 || $conf['comparison'] === 69 || $conf['comparison'] === 162 || $conf['comparison'] === 163) { > // in list: > if (is_array($conf['inputValue' . $suffix])) { > $inputVal = implode(',', $conf['inputValue' . $suffix]); > } elseif ($conf['inputValue' . $suffix]) { > $inputVal = $conf['inputValue' . $suffix]; > } else { > $inputVal = 0; > } > } elseif (!is_array($conf['inputValue' . $suffix]) && strtotime($conf['inputValue' . $suffix])) { > $inputVal = $conf['inputValue' . $suffix]; > } elseif (!is_array($conf['inputValue' . $suffix]) && MathUtility::canBeInterpretedAsInteger($conf['inputValue' . $suffix])) { > $inputVal = (int)$conf['inputValue' . $suffix]; > } else { > // TODO: Six eyes looked at this code and nobody understood completely what is going on here and why we > // fallback to float casting, the whole class smells like it needs a refactoring. > $inputVal = (float)$conf['inputValue' . $suffix]; > } > 1438c1473 < if (in_array('table', $enableArr) && !$userTsConfig['mod.']['dbint.']['disableSelectATable']) { --- > if (in_array('table', $enableArr) && ! isset($userTsConfig['mod.']['dbint.']['disableSelectATable'])) { 1446,1448c1481,1489 < $this->setAndCleanUpExternalLists('queryFields', $modSettings['queryFields'], 'uid,' . $this->getLabelCol()); < $this->setAndCleanUpExternalLists('queryGroup', $modSettings['queryGroup']); < $this->setAndCleanUpExternalLists('queryOrder', $modSettings['queryOrder'] . ',' . $modSettings['queryOrder2']); --- > if (isset($modSettings['queryFields'])){ > $this->setAndCleanUpExternalLists('queryFields', $modSettings['queryFields'], 'uid,' . $this->getLabelCol()); > } > if (isset($modSettings['queryGroup'])){ > $this->setAndCleanUpExternalLists('queryGroup', $modSettings['queryGroup']); > } > if (isset($modSettings['queryOrder'])){ > $this->setAndCleanUpExternalLists('queryOrder', $modSettings['queryOrder'] . ',' . $modSettings['queryOrder2']); > } 1450c1491 < $this->extFieldLists['queryLimit'] = $modSettings['queryLimit']; --- > isset($modSettings['queryLimit']) ? $this->extFieldLists['queryLimit'] = $modSettings['queryLimit'] : $this->extFieldLists['queryLimit'] = ''; 1457c1498 < if ($parts[1]) { --- > if (isset($parts[1])) { 1463c1504 < if ($this->extFieldLists['queryOrder']) { --- > if (isset($this->extFieldLists['queryOrder'])) { 1471a1513,1526 > > // defaults > $ardefaults = [ > 'mod.' => [ > 'dbint.' => [ > 'disableSelectFields' => false, > 'disableMakeQuery'=> false, > 'disableGroupBy'=> false, > 'disableOrderBy' => false, > ] > ] > ]; > $userTsConfig = array_merge_recursive($ardefaults, $userTsConfig); > 1598c1653 < $queryBuilder->expr()->eq('pid', $queryBuilder->createNamedParameter($id, Connection::PARAM_INT)), --- > $queryBuilder->expr()->eq('pid', $queryBuilder->createNamedParameter($id, \PDO::PARAM_INT)), 1646c1701 < if ($this->extFieldLists['queryGroup']) { --- > if (isset($this->extFieldLists['queryGroup'])) { 1649c1704 < if ($this->extFieldLists['queryOrder']) { --- > if (isset($this->extFieldLists['queryOrder'])) { 1655c1710 < if ($this->extFieldLists['queryLimit']) { --- > if (isset($this->extFieldLists['queryLimit'])) {