diff --git a/CHANGELOG.md b/CHANGELOG.md index cab0ca0..beecdcb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to this project will be documented in this file. +## [1.48.4] - 2022-02-14 + +- Fixed: array index issues in php 8+ + ## [1.48.3] - 2022-02-10 - Removed: truncate-html and twig extra bundles diff --git a/src/Item/DefaultItem.php b/src/Item/DefaultItem.php index 909cbb0..27250e7 100644 --- a/src/Item/DefaultItem.php +++ b/src/Item/DefaultItem.php @@ -290,7 +290,7 @@ public function setFormattedValue(string $name, $value, bool $formatted = false) */ public function getFormattedValue(string $name) { - return $this->_formatted[$name]; + return $this->_formatted[$name] ?? null; } /** diff --git a/src/Lists/DefaultList.php b/src/Lists/DefaultList.php index de0a2df..732f723 100644 --- a/src/Lists/DefaultList.php +++ b/src/Lists/DefaultList.php @@ -698,7 +698,7 @@ public function addDataAttributes() $listConfig = $this->_manager->getListConfig(); foreach ($GLOBALS['TL_DCA']['tl_list_config']['fields'] as $field => $data) { - if ($data['eval']['addAsDataAttribute'] && $listConfig->{$field}) { + if (($data['eval']['addAsDataAttribute'] ?? false) && $listConfig->{$field}) { $dataAttributes[] = 'data-'.$stringUtil->camelCaseToDashed($field).'="'.$listConfig->{$field}.'"'; } } diff --git a/src/Resources/contao/dca/tl_list_config.php b/src/Resources/contao/dca/tl_list_config.php index 6e11b81..2feb30a 100644 --- a/src/Resources/contao/dca/tl_list_config.php +++ b/src/Resources/contao/dca/tl_list_config.php @@ -1,7 +1,7 @@ &$GLOBALS['TL_LANG']['tl_list_config']['delete'], 'href' => 'act=delete', 'icon' => 'delete.gif', - 'attributes' => 'onclick="if(!confirm(\''.$GLOBALS['TL_LANG']['MSC']['deleteConfirm'].'\'))return false;Backend.getScrollOffset()"', + 'attributes' => 'onclick="if(!confirm(\''.($GLOBALS['TL_LANG']['MSC']['deleteConfirm'] ?? null).'\'))return false;Backend.getScrollOffset()"', ], 'show' => [ 'label' => &$GLOBALS['TL_LANG']['tl_list_config']['show'], diff --git a/src/Resources/contao/dca/tl_list_config_element.php b/src/Resources/contao/dca/tl_list_config_element.php index 77f44ce..be42e64 100644 --- a/src/Resources/contao/dca/tl_list_config_element.php +++ b/src/Resources/contao/dca/tl_list_config_element.php @@ -1,7 +1,7 @@ &$GLOBALS['TL_LANG']['tl_list_config_element']['delete'], 'href' => 'act=delete', 'icon' => 'delete.gif', - 'attributes' => 'onclick="if(!confirm(\''.$GLOBALS['TL_LANG']['MSC']['deleteConfirm'].'\'))return false;Backend.getScrollOffset()"', + 'attributes' => 'onclick="if(!confirm(\''.($GLOBALS['TL_LANG']['MSC']['deleteConfirm'] ?? null).'\'))return false;Backend.getScrollOffset()"', ], 'show' => [ 'label' => &$GLOBALS['TL_LANG']['tl_list_config_element']['show'],