diff --git a/typo3/sysext/backend/Classes/Template/Components/Buttons/SplitButton.php b/typo3/sysext/backend/Classes/Template/Components/Buttons/SplitButton.php index 81d262aa03e2..80d39dd3dfbe 100644 --- a/typo3/sysext/backend/Classes/Template/Components/Buttons/SplitButton.php +++ b/typo3/sysext/backend/Classes/Template/Components/Buttons/SplitButton.php @@ -119,13 +119,9 @@ public function getButton() public function isValid() { $subject = $this->getButton(); - if (isset($subject['primary']) - && ($subject['primary'] instanceof AbstractButton) - && isset($subject['options']) - ) { - return true; - } - return false; + return isset($subject['primary']) + && ($subject['primary'] instanceof AbstractButton) + && isset($subject['options']); } /** @@ -139,13 +135,17 @@ public function render() $attributes = [ 'type' => 'submit', 'class' => 'btn btn-sm btn-default ' . $items['primary']->getClasses(), - 'name' => $items['primary']->getName(), - 'value' => $items['primary']->getValue() ]; + if (method_exists($items['primary'], 'getName')) { + $attributes['name'] = $items['primary']->getName(); + } + if (method_exists($items['primary'], 'getValue')) { + $attributes['value'] = $items['primary']->getValue(); + } if (!empty($items['primary']->getOnClick())) { $attributes['onclick'] = $items['primary']->getOnClick(); } - if (!empty($items['primary']->getForm())) { + if (method_exists($items['primary'], 'getForm') && !empty($items['primary']->getForm())) { $attributes['form'] = $items['primary']->getForm(); } $attributesString = ''; @@ -164,28 +164,37 @@ public function render()