Commit 8b0a8836 authored by crell's avatar crell Committed by Benni Mack
Browse files

[TASK] Resolve still more PHP 8 issues

Resolves: #94057
Releases: master
Change-Id: I238a98d5161417465c02ae8683aef83f55a05ecc
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/69255


Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Jochen's avatarJochen <rothjochen@gmail.com>
Tested-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Reviewed-by: Jochen's avatarJochen <rothjochen@gmail.com>
Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
parent 295f2523
......@@ -52,7 +52,7 @@ class ClearCacheToolbarItem implements ToolbarItemInterface
$uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
// Clear all page-related caches
if ($isAdmin || $userTsConfig['options.']['clearCache.']['pages'] ?? false) {
if ($isAdmin || ($userTsConfig['options.']['clearCache.']['pages'] ?? false)) {
$this->cacheActions[] = [
'id' => 'pages',
'title' => 'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:flushPageCachesTitle',
......
......@@ -1927,7 +1927,7 @@ class EditDocumentController
if (!isset($uc['inlineView']) || !is_array($uc['inlineView'])) {
return;
}
$inlineView = (array)json_decode(is_string($backendUser->uc['inlineView']) ? $backendUser->uc['inlineView'] : '', true);
$inlineView = (array)json_decode(is_string($backendUser->uc['inlineView'] ?? false) ? $backendUser->uc['inlineView'] : '', true);
foreach ($uc['inlineView'] as $topTable => $topRecords) {
foreach ($topRecords as $topUid => $childElements) {
foreach ($childElements as $childTable => $childRecords) {
......
......@@ -486,7 +486,7 @@ class FormInlineAjaxController extends AbstractFormEngineAjaxController
// and $combinationChild is the child-child. For "normal" relations, $mainChild
// is just the normal child record and $combinationChild is empty.
$mainChild = $formDataCompiler->compile($formDataCompilerInput);
if ($parentConfig['foreign_selector'] && $parentConfig['appearance']['useCombination']) {
if (($parentConfig['foreign_selector'] ?? false) && ($parentConfig['appearance']['useCombination'] ?? false)) {
// This kicks in if opening an existing mainChild that has a child-child set
$mainChild['combinationChild'] = $this->compileChildChild($mainChild, $parentConfig, $inlineStructure);
}
......
......@@ -266,16 +266,16 @@ class BackendModuleRepository implements SingletonInterface
'description' => $moduleLabels['shortdescription'],
'standalone' => (bool)($moduleData['standalone'] ?? false)
];
if ((($moduleData['standalone'] ?? false) === false) && !is_array($moduleData['sub']) && $moduleData['script'] !== $dummyScript) {
if ((($moduleData['standalone'] ?? false) === false) && !is_array($moduleData['sub'] ?? null) && ($moduleData['script'] ?? null) !== $dummyScript) {
// Work around for modules with own main entry, but being self the only submodule
$modules[$moduleKey]['subitems'][$moduleKey] = [
'name' => $moduleName,
'title' => $moduleLabels['title'],
'title' => $moduleLabels['title'] ?? '',
'icon' => $this->getModuleIcon($moduleKey, $moduleData),
'link' => $moduleLink,
'component' => $moduleComponent,
'originalLink' => $moduleLink,
'description' => $moduleLabels['shortdescription'],
'description' => $moduleLabels['shortdescription'] ?? '',
'navigationFrameScript' => null,
'navigationFrameScriptParam' => null,
'navigationComponentId' => null
......
......@@ -64,7 +64,7 @@ class FlexFormSectionContainer extends AbstractContainer
$options['flexFormFormPrefix'] = $this->data['flexFormFormPrefix'] . '[' . $flexFormFieldName . '][el]';
$options['flexFormContainerName'] = $existingSectionContainerDataStructureType;
$options['flexFormContainerIdentifier'] = $flexFormContainerIdentifier;
$options['flexFormContainerElementCollapsed'] = (bool)$flexFormRowData[$flexFormContainerIdentifier]['_TOGGLE'];
$options['flexFormContainerElementCollapsed'] = (bool)($flexFormRowData[$flexFormContainerIdentifier]['_TOGGLE'] ?? false);
$options['renderType'] = 'flexFormContainerContainer';
$flexFormContainerContainerResult = $this->nodeFactory->create($options)->render();
$resultArray = $this->mergeChildReturnIntoExistingResult($resultArray, $flexFormContainerContainerResult);
......
......@@ -222,7 +222,9 @@ class InlineControlContainer extends AbstractContainer
}
// Note structure of $value is different in select vs. group: It's a uid for select, but an
// array with uid + table for group.
$uniqueIds[$child['databaseRow']['uid']] = $value;
if (isset($child['databaseRow']['uid'])) {
$uniqueIds[$child['databaseRow']['uid']] = $value;
}
}
}
$possibleRecords = $config['selectorOrUniquePossibleRecords'] ?? [];
......@@ -334,7 +336,7 @@ class InlineControlContainer extends AbstractContainer
$childResult = $this->nodeFactory->create($options)->render();
$html .= $childResult['html'];
$resultArray = $this->mergeChildReturnIntoExistingResult($resultArray, $childResult, false);
if (!$options['isInlineDefaultLanguageRecordInLocalizedParentContext']) {
if (!$options['isInlineDefaultLanguageRecordInLocalizedParentContext'] && isset($options['databaseRow']['uid'])) {
// Don't add record to list of "valid" uids if it is only the default
// language record of a not yet localized child
$sortableRecordUids[] = $options['databaseRow']['uid'];
......
......@@ -113,8 +113,8 @@ class InlineRecordContainer extends AbstractContainer
$resultArray['inlineData'] = $this->inlineData;
// Get the current naming scheme for DOM name/id attributes:
$appendFormFieldNames = '[' . $foreignTable . '][' . $record['uid'] . ']';
$objectId = $domObjectId . '-' . $foreignTable . '-' . $record['uid'];
$appendFormFieldNames = '[' . $foreignTable . '][' . ($record['uid'] ?? 0) . ']';
$objectId = $domObjectId . '-' . $foreignTable . '-' . ($record['uid'] ?? 0);
$classes = [];
$html = '';
$combinationHtml = '';
......@@ -184,10 +184,17 @@ class InlineRecordContainer extends AbstractContainer
}
$originalUniqueValue = '';
if (isset($data['inlineData']['unique'][$domObjectId . '-' . $foreignTable]['used'][$record['uid']])) {
if (isset($record['uid'], $data['inlineData']['unique'][$domObjectId . '-' . $foreignTable]['used'][$record['uid']])) {
$uniqueValueValues = $data['inlineData']['unique'][$domObjectId . '-' . $foreignTable]['used'][$record['uid']];
// in case of site_language we don't have the full form engine options, so fallbacks need to be taken into account
$originalUniqueValue = ($uniqueValueValues['table'] ?? $foreignTable) . '_' . ($uniqueValueValues['uid'] ?? $uniqueValueValues);
$originalUniqueValue = ($uniqueValueValues['table'] ?? $foreignTable) . '_';
// @todo In what circumstance would $uniqueValueValues be an array that lacks a 'uid' key? Unclear, but
// it breaks the string concatenation. This is a hacky workaround for type safety only.
$uVV = ($uniqueValueValues['uid'] ?? $uniqueValueValues);
if (is_array($uVV)) {
$uVV = implode(',', $uVV);
}
$originalUniqueValue .= $uVV;
}
// The hashed object id needs a non-numeric prefix, the value is used as ID selector in JavaScript
......@@ -195,7 +202,7 @@ class InlineRecordContainer extends AbstractContainer
$containerAttributes = [
'id' => $objectId . '_div',
'class' => 'form-irre-object panel panel-default panel-condensed ' . trim(implode(' ', $classes)),
'data-object-uid' => $record['uid'],
'data-object-uid' => $record['uid'] ?? 0,
'data-object-id' => $objectId,
'data-object-id-hash' => $hashedObjectId,
'data-object-parent-group' => $domObjectId . '-' . $foreignTable,
......@@ -330,7 +337,7 @@ class InlineRecordContainer extends AbstractContainer
$rec = $data['databaseRow'];
// Init:
$domObjectId = $this->inlineStackProcessor->getCurrentStructureDomObjectIdPrefix($data['inlineFirstPid']);
$objectId = $domObjectId . '-' . $foreignTable . '-' . $rec['uid'];
$objectId = $domObjectId . '-' . $foreignTable . '-' . ($rec['uid'] ?? 0);
$recordTitle = $data['recordTitle'];
if (!empty($recordTitle)) {
......@@ -350,7 +357,7 @@ class InlineRecordContainer extends AbstractContainer
$thumbnail = false;
// Renders a thumbnail for the header
if ($GLOBALS['TYPO3_CONF_VARS']['GFX']['thumbnails'] && !empty($inlineConfig['appearance']['headerThumbnail']['field'])) {
if (($GLOBALS['TYPO3_CONF_VARS']['GFX']['thumbnails'] ?? false) && !empty($inlineConfig['appearance']['headerThumbnail']['field'])) {
$fieldValue = $rec[$inlineConfig['appearance']['headerThumbnail']['field']];
$fileUid = $fieldValue[0]['uid'];
......@@ -365,7 +372,7 @@ class InlineRecordContainer extends AbstractContainer
. htmlspecialchars($languageService->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:warning.file_missing'))
. '</span>&nbsp;' . htmlspecialchars($fileObject->getName()) . '<br />';
} elseif ($fileObject) {
$imageSetup = $inlineConfig['appearance']['headerThumbnail'];
$imageSetup = $inlineConfig['appearance']['headerThumbnail'] ?? [];
unset($imageSetup['field']);
$cropVariantCollection = CropVariantCollection::create($rec['crop'] ?? '');
if (!$cropVariantCollection->getCropArea()->isEmpty()) {
......@@ -373,7 +380,7 @@ class InlineRecordContainer extends AbstractContainer
}
$imageSetup = array_merge(['maxWidth' => '145', 'maxHeight' => '45'], $imageSetup);
if ($GLOBALS['TYPO3_CONF_VARS']['GFX']['thumbnails'] && $fileObject->isImage()) {
if (($GLOBALS['TYPO3_CONF_VARS']['GFX']['thumbnails'] ?? false) && $fileObject->isImage()) {
$processedImage = $fileObject->process(ProcessedFile::CONTEXT_IMAGECROPSCALEMASK, $imageSetup);
// Only use a thumbnail if the processing process was successful by checking if image width is set
if ($processedImage->getProperty('width')) {
......@@ -491,7 +498,7 @@ class InlineRecordContainer extends AbstractContainer
// If the table is NOT a read-only table, then show these links:
if (!$isParentReadOnly && !($tcaTableCtrl['readOnly'] ?? false) && !($data['isInlineDefaultLanguageRecordInLocalizedParentContext'] ?? false)) {
// "New record after" link (ONLY if the records in the table are sorted by a "sortby"-row or if default values can depend on previous record):
if ($enabledControls['new'] && ($enableManualSorting || $tcaTableCtrl['useColumnsForDefaultValues'])) {
if (($enabledControls['new'] ?? false) && ($enableManualSorting || ($tcaTableCtrl['useColumnsForDefaultValues'] ?? false))) {
if ((!$isPagesTable && $calcPerms->editContentPermissionIsGranted()) || ($isPagesTable && $calcPerms->createPagePermissionIsGranted())) {
$style = '';
if ($inlineConfig['inline']['inlineNewButtonStyle'] ?? false) {
......
......@@ -219,7 +219,7 @@ class SingleFieldContainer extends AbstractContainer
]
];
// Get the parent record from structure stack
$level = $inlineStackProcessor->getStructureLevel(-1);
$level = $inlineStackProcessor->getStructureLevel(-1) ?: [];
// If we have symmetric fields, check on which side we are and hide fields, that are set automatically:
if ($this->data['isOnSymmetricSide']) {
$searchArray['%OR']['config'][0]['%AND']['%OR']['symmetric_field'] = $fieldName;
......
......@@ -200,7 +200,7 @@ class ImageManipulationElement extends AbstractFormElement
'TYPO3/CMS/Backend/ImageManipulation' => 'function (ImageManipulation) {ImageManipulation.initializeTrigger(); }'
];
$arguments['formEngine']['field']['id'] = StringUtility::getUniqueId('formengine-image-manipulation-');
if (GeneralUtility::inList($config['eval'], 'required')) {
if (GeneralUtility::inList($config['eval'] ?? '', 'required')) {
$arguments['formEngine']['validation'] = $this->getValidationDataAsJsonString(['required' => true]);
}
}
......
......@@ -292,7 +292,7 @@ class InputTextElement extends AbstractFormElement
$fullElement = implode(LF, $fullElement);
} elseif ($this->hasNullCheckboxWithPlaceholder()) {
$checked = $itemValue !== null ? ' checked="checked"' : '';
$placeholder = $shortenedPlaceholder = trim($config['placeholder']) ?? '';
$placeholder = $shortenedPlaceholder = trim($config['placeholder'] ?? '');
$disabled = '';
$fallbackValue = 0;
if (strlen($placeholder) > 0) {
......
......@@ -92,14 +92,14 @@ class SelectSingleElement extends AbstractFormElement
// See InlineControlContainer where 'inlineData' 'unique' 'used' is set. What exactly is
// this if supposed to do and when should it kick in and what for?
$inlineObjectName = $inlineStackProcessor->getCurrentStructureDomObjectIdPrefix($this->data['inlineFirstPid']);
if ($this->data['inlineParentConfig']['foreign_table'] === $table
&& $this->data['inlineParentConfig']['foreign_unique'] === $field
if (($this->data['inlineParentConfig']['foreign_table'] ?? false) === $table
&& ($this->data['inlineParentConfig']['foreign_unique'] ?? false) === $field
) {
$classList[] = 't3js-inline-unique';
$uniqueIds = $this->data['inlineData']['unique'][$inlineObjectName . '-' . $table]['used'];
}
// hide uid of parent record for symmetric relations
if ($this->data['inlineParentConfig']['foreign_table'] === $table
if (($this->data['inlineParentConfig']['foreign_table'] ?? false) === $table
&& (
($this->data['inlineParentConfig']['foreign_field'] ?? false) === $field
|| ($this->data['inlineParentConfig']['symmetric_field'] ?? false) === $field
......
......@@ -40,7 +40,7 @@ class ElementBrowser extends AbstractNode
$elementName = $parameterArray['itemFormElName'];
$config = $parameterArray['fieldConf']['config'];
$internalType = (string)$config['internal_type'];
$allowed = $config['allowed'];
$allowed = $config['allowed'] ?? '';
if (isset($config['readOnly']) && $config['readOnly']) {
return [];
......@@ -57,10 +57,10 @@ class ElementBrowser extends AbstractNode
$inlineStackProcessor = GeneralUtility::makeInstance(InlineStackProcessor::class);
$inlineStackProcessor->initializeByGivenStructure($this->data['inlineStructure']);
$elementBrowserOnClickInline = '';
if ($this->data['isInlineChild']
&& $this->data['inlineParentUid']
&& $this->data['inlineParentConfig']['foreign_table'] === $table
&& $this->data['inlineParentConfig']['foreign_unique'] === $fieldName
if (($this->data['isInlineChild'] ?? false)
&& ($this->data['inlineParentUid'] ?? false)
&& ($this->data['inlineParentConfig']['foreign_table'] ?? false) === $table
&& ($this->data['inlineParentConfig']['foreign_unique'] ?? false) === $fieldName
) {
$objectPrefix = $inlineStackProcessor->getCurrentStructureDomObjectIdPrefix($this->data['inlineFirstPid']) . '-' . $table;
$elementBrowserOnClickInline = $objectPrefix;
......
......@@ -1035,7 +1035,7 @@ abstract class AbstractItemProvider
{
$table = $result['tableName'];
$row = $result['databaseRow'];
$uid = $row['uid'];
$uid = $row['uid'] ?? 0;
if (BackendUtility::isTableWorkspaceEnabled($table) && (int)($row['t3ver_oid'] ?? 0) > 0) {
$uid = $row['t3ver_oid'];
}
......
......@@ -632,16 +632,16 @@ class EvaluateDisplayConditions implements FormDataProviderInterface
}
}
// If field was not removed and if it is a flex field, add to list of flex fields to scan
if ($conditionResult && $columnConfiguration['config']['type'] === 'flex') {
if ($conditionResult && ($columnConfiguration['config']['type'] ?? false) === 'flex') {
$listOfFlexFieldNames[] = $columnName;
}
}
// Search for flex fields and evaluate sheet conditions throwing them away if needed
foreach ($listOfFlexFieldNames as $columnName) {
$columnConfiguration = $result['processedTca']['columns'][$columnName];
$columnConfiguration = $result['processedTca']['columns'][$columnName] ?? [];
foreach ($columnConfiguration['config']['ds']['sheets'] as $sheetName => $sheetConfiguration) {
if (isset($sheetConfiguration['ROOT']['displayCond']) && is_array($sheetConfiguration['ROOT']['displayCond'])) {
if (is_array($sheetConfiguration['ROOT']['displayCond'] ?? false)) {
if (!$this->evaluateConditionRecursive($sheetConfiguration['ROOT']['displayCond'])) {
unset($result['processedTca']['columns'][$columnName]['config']['ds']['sheets'][$sheetName]);
} else {
......
......@@ -19,6 +19,7 @@ namespace TYPO3\CMS\Backend\Form\FormDataProvider;
use TYPO3\CMS\Backend\Form\FormDataProviderInterface;
use TYPO3\CMS\Core\Configuration\SiteConfiguration;
use TYPO3\CMS\Core\Exception\SiteNotFoundException;
use TYPO3\CMS\Core\Site\SiteFinder;
use TYPO3\CMS\Core\Utility\GeneralUtility;
......@@ -53,6 +54,7 @@ class SiteDatabaseEditRow implements FormDataProviderInterface
}
$tableName = $result['tableName'];
/** @var SiteFinder $siteFinder */
$siteFinder = GeneralUtility::makeInstance(SiteFinder::class, $this->siteConfiguration);
if ($tableName === 'site') {
$rootPageId = (int)$result['vanillaUid'];
......@@ -61,13 +63,17 @@ class SiteDatabaseEditRow implements FormDataProviderInterface
$result['databaseRow']['identifier'] = $result['customData']['siteIdentifier'];
} elseif (in_array($tableName, ['site_errorhandling', 'site_language', 'site_route', 'site_base_variant'], true)) {
$rootPageId = (int)($result['inlineTopMostParentUid'] ?? $result['inlineParentUid']);
$rowData = $this->getRawConfigurationForSiteWithRootPageId($siteFinder, $rootPageId);
$parentFieldName = $result['inlineParentFieldName'];
if (!isset($rowData[$parentFieldName])) {
throw new \RuntimeException('Field "' . $parentFieldName . '" not found', 1520886092);
try {
$rowData = $this->getRawConfigurationForSiteWithRootPageId($siteFinder, $rootPageId);
$parentFieldName = $result['inlineParentFieldName'];
if (!isset($rowData[$parentFieldName])) {
throw new \RuntimeException('Field "' . $parentFieldName . '" not found', 1520886092);
}
$rowData = $rowData[$parentFieldName][$result['vanillaUid']];
$result['databaseRow']['uid'] = $result['vanillaUid'];
} catch (SiteNotFoundException $e) {
$rowData = [];
}
$rowData = $rowData[$parentFieldName][$result['vanillaUid']];
$result['databaseRow']['uid'] = $result['vanillaUid'];
} else {
throw new \RuntimeException('Other tables not implemented', 1520886234);
}
......
......@@ -97,7 +97,7 @@ class SiteTcaInline extends AbstractDatabaseRecordProvider implements FormDataPr
}
if (MathUtility::canBeInterpretedAsInteger($pid)) {
$pageRecord = BackendUtility::getRecord('pages', (int)$pid);
if ((int)$pageRecord[$GLOBALS['TCA']['pages']['ctrl']['transOrigPointerField']] > 0) {
if (($pageRecord[$GLOBALS['TCA']['pages']['ctrl']['transOrigPointerField'] ?? null] ?? 0) > 0) {
$pid = (int)$pageRecord[$GLOBALS['TCA']['pages']['ctrl']['transOrigPointerField']];
}
} elseif (strpos($pid, 'NEW') !== 0) {
......@@ -131,13 +131,13 @@ class SiteTcaInline extends AbstractDatabaseRecordProvider implements FormDataPr
$site = null;
}
$siteConfiguration = $site ? $site->getConfiguration() : [];
if (is_array($siteConfiguration[$fieldName])) {
if (is_array($siteConfiguration[$fieldName] ?? false)) {
$connectedUids = array_keys($siteConfiguration[$fieldName]);
}
}
// If we are dealing with site_language, we *always* force a relation to sys_language "0"
$foreignTable = $result['processedTca']['columns'][$fieldName]['config']['foreign_table'];
$foreignTable = $result['processedTca']['columns'][$fieldName]['config']['foreign_table'] ?? '';
if ($foreignTable === 'site_language' && $result['command'] === 'new') {
// If new, just add a new default child
$child = $this->compileDefaultSysSiteLanguageChild($result, $fieldName);
......@@ -160,7 +160,7 @@ class SiteTcaInline extends AbstractDatabaseRecordProvider implements FormDataPr
// If edit, find out if a child using sys_language "0" exists, else add it on top
$defaultSysSiteLanguageChildFound = false;
foreach ($result['processedTca']['columns'][$fieldName]['children'] as $child) {
if (isset($child['databaseRow']['languageId']) && (int)$child['databaseRow']['languageId'][0] == 0) {
if (isset($child['databaseRow']['languageId']) && ($child['databaseRow']['languageId'][0] ?? 0) == 0) {
$defaultSysSiteLanguageChildFound = true;
}
}
......@@ -239,6 +239,7 @@ class SiteTcaInline extends AbstractDatabaseRecordProvider implements FormDataPr
$parentConfig = $result['processedTca']['columns'][$parentFieldName]['config'];
$childTableName = $parentConfig['foreign_table'];
/** @var InlineStackProcessor $inlineStackProcessor */
$inlineStackProcessor = GeneralUtility::makeInstance(InlineStackProcessor::class);
$inlineStackProcessor->initializeByGivenStructure($result['inlineStructure']);
$inlineTopMostParent = $inlineStackProcessor->getStructureLevel(0);
......@@ -266,9 +267,9 @@ class SiteTcaInline extends AbstractDatabaseRecordProvider implements FormDataPr
'inlineParentFieldName' => $parentFieldName,
// values of the top most parent element set on first level and not overridden on following levels
'inlineTopMostParentUid' => $result['inlineTopMostParentUid'] ?: $inlineTopMostParent['uid'],
'inlineTopMostParentTableName' => $result['inlineTopMostParentTableName'] ?: $inlineTopMostParent['table'],
'inlineTopMostParentFieldName' => $result['inlineTopMostParentFieldName'] ?: $inlineTopMostParent['field'],
'inlineTopMostParentUid' => $result['inlineTopMostParentUid'] ?: ($inlineTopMostParent['uid'] ?? 0),
'inlineTopMostParentTableName' => $result['inlineTopMostParentTableName'] ?: ($inlineTopMostParent['table'] ?? ''),
'inlineTopMostParentFieldName' => $result['inlineTopMostParentFieldName'] ?: ($inlineTopMostParent['field'] ?? ''),
];
if ($parentConfig['foreign_selector'] && ($parentConfig['appearance']['useCombination'] ?? false)) {
......
......@@ -51,7 +51,7 @@ class TcaInlineExpandCollapseState implements FormDataProviderInterface
// Default case for a single record
if ($result['command'] !== 'new') {
$table = $result['tableName'];
$uid = $result['databaseRow']['uid'];
$uid = $result['databaseRow']['uid'] ?? 0;
if (!empty($fullInlineState[$table][$uid])) {
$inlineStateForTable = $fullInlineState[$table][$uid];
}
......
......@@ -43,7 +43,7 @@ class TcaInputPlaceholders implements FormDataProviderInterface
foreach ($result['processedTca']['columns'] as $fieldName => $fieldConfig) {
// Placeholders are only valid for input and text type fields
if (
($fieldConfig['config']['type'] !== 'input' && $fieldConfig['config']['type'] !== 'text')
(!in_array($fieldConfig['config']['type'] ?? false, ['input', 'text']))
|| !isset($fieldConfig['config']['placeholder'])
) {
continue;
......
......@@ -180,7 +180,7 @@ class InlineStackProcessor
* Hint: If -1 is given, the "current" - most bottom "stable" item is returned
*
* @param int $level Which level to return
* @return array The item of the stack at the requested level
* @return array|false The item of the stack at the requested level, or false if not found.
*/
public function getStructureLevel($level)
{
......@@ -241,7 +241,7 @@ class InlineStackProcessor
$structureDepth = $structureCount;
}
for ($i = 1; $i <= $structureDepth; $i++) {
array_unshift($structureLevels, $this->getStructureItemName($this->getStructureLevel(-$i), 'Disposal_AttributeId'));
array_unshift($structureLevels, ($this->getStructureItemName($this->getStructureLevel(-$i) ?: [], 'Disposal_AttributeId') ?: []));
}
return implode('-', $structureLevels);
}
......
......@@ -78,8 +78,8 @@ class ElementBrowserRecordList extends DatabaseRecordList
{
$returnValue = true;
if ($this->relatingField && $this->relatingTable) {
$tcaFieldConfig = $GLOBALS['TCA'][$this->relatingTable]['columns'][$this->relatingField]['config'];
if (is_array($tcaFieldConfig['filter'])) {
$tcaFieldConfig = $GLOBALS['TCA'][$this->relatingTable]['columns'][$this->relatingField]['config'] ?? [];
if (is_array($tcaFieldConfig['filter'] ?? false)) {
foreach ($tcaFieldConfig['filter'] as $filter) {
if (!$filter['userFunc']) {
continue;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment