Skip to content

Commit

Permalink
[Update] Fix undefined array key warning
Browse files Browse the repository at this point in the history
  • Loading branch information
zoglo committed Jan 23, 2023
1 parent 6e68f1b commit a1202ff
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions contao/dca/tl_style_manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
'label' => &$GLOBALS['TL_LANG']['tl_style_manager']['realEstateFilterItems'],
'inputType' => 'checkbox',
'options_callback' => ['tl_style_manager_estatemanager', 'getRealEstateFilterItems'],
'reference' => $GLOBALS['TL_LANG']['RFI'] ?? $GLOBALS['TL_LANG']['CEM_RFI'], // BC-Layer for EM < 2.0
'reference' => $GLOBALS['TL_LANG']['RFI'] ?? ($GLOBALS['TL_LANG']['CEM_RFI'] ?? null), // BC-Layer for EM < 2.0
'eval' => ['multiple'=>true, 'mandatory'=>true, 'tl_class'=>'w50 clr'],
'sql' => "blob NULL"
];
Expand Down Expand Up @@ -96,7 +96,12 @@ public function __construct()
*/
public function getRealEstateFilterItems()
{
return array_keys($GLOBALS['TL_RFI'] ?? $GLOBALS['CEM_RFI']); // BC-Layer for EM < 2.0
if (isset($GLOBALS['TL_RFI']) || isset($GLOBALS['CEM_RFI']))
{
return array_keys($GLOBALS['TL_RFI'] ?? $GLOBALS['CEM_RFI']); // BC-Layer for EM < 2.0
}

return []; // BC-Layer for EM < 2.0
}

/**
Expand Down

0 comments on commit a1202ff

Please sign in to comment.