From 500b2c83b9ea894319ee94287d3cf41d7bc51a9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20D=C3=B6rr?= <54935227+lukasdoerr@users.noreply.github.com> Date: Mon, 13 Mar 2023 11:52:35 +0100 Subject: [PATCH] [FIX] Added PHP 8 compatibility for empty array --- Classes/Hooks/ShyGuyHook.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Classes/Hooks/ShyGuyHook.php b/Classes/Hooks/ShyGuyHook.php index 8fcc45f..819e770 100644 --- a/Classes/Hooks/ShyGuyHook.php +++ b/Classes/Hooks/ShyGuyHook.php @@ -25,7 +25,12 @@ class ShyGuyHook public function addSoftHyphenInitial($params, &$buttonBar): array { $buttons = $params['buttons']; - $saveButton = $buttons[ButtonBar::BUTTON_POSITION_LEFT][2][0]; + if(isset($buttons[ButtonBar::BUTTON_POSITION_LEFT][2][0])){ + $saveButton = $buttons[ButtonBar::BUTTON_POSITION_LEFT][2][0]; + } + else { + $saveButton = null; + } if ($saveButton instanceof InputButton && $saveButton->getName() === '_savedok') { $iconFactory = GeneralUtility::makeInstance(IconFactory::class);