Project

General

Profile

Actions

Bug #88408

closed

AbstractButtonViewHelper ignores option 'showLabel'

Added by Georg Tiefenbrunn almost 5 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
Backend API
Target version:
Start date:
2019-05-21
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
easy
Is Regression:
Sprint Focus:

Description

TYPO3 v9.5 (introduced with https://review.typo3.org/c/Packages/TYPO3.CMS/+/51091)

<be:moduleLayout.button.linkButton icon="actions-open" title="..." link="..." showLabel="true" />

TYPO3\CMS\Backend\ViewHelpers\ModuleLayout\Button\AbstractButtonViewHelper initializes the argument showLabel ("Defines whether to show the title as a label within the button"), but this argument is not applied to $button. Thus the button is always rendered as "icon only" (without label text).

See line 90 AbstractButtonViewHelper::addDefaultAttributes()

    private static function addDefaultAttributes(AbstractButton $button, array $arguments, RenderingContextInterface $renderingContext): void
    {
        if (isset($arguments['title'])) {
            $button->setTitle($arguments['title']);
        }
        /** @var ModuleTemplate $moduleTemplate */
        $moduleTemplate = $renderingContext->getViewHelperVariableContainer()->get(ModuleLayoutViewHelper::class, ModuleTemplate::class);
        $button->setIcon($moduleTemplate->getIconFactory()->getIcon($arguments['icon'], Icon::SIZE_SMALL));
    }

-        if (isset($arguments['title'])) {
-            $button->setTitle($arguments['title']);
-        }
+        if (isset($arguments['title'])) {
+            $button->setTitle($arguments['title']);
+        }
+        if (isset($arguments['showLabel'])) {
+            $button->setShowLabelText($arguments['showLabel']);
+        }

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #85532: Convert backend user module to use view helpers for configuring module layoutClosedHelmut Hummel2018-07-10

Actions
Actions

Also available in: Atom PDF