Bug #88408

AbstractButtonViewHelper ignores option 'showLabel'

Added by Georg Tiefenbrunn about 1 month ago. Updated about 1 month ago.

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

100%

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

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

Associated revisions

Revision 01626d64 (diff)
Added by Georg Ringer about 1 month ago

[BUGFIX] Respect argument showLabel in AbstractButtonViewHelper

The argument `showLabel` must be used while creating a button.

Resolves: #88408
Releases: master, 9.5
Change-Id: I5bfcc25d03aac9da6ca11b651658749bf25d7bf1
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/60789
Tested-by: TYPO3com <>
Tested-by: Markus Klein <>
Tested-by: Josef Glatz <>
Tested-by: Andreas Fernandez <>
Reviewed-by: Markus Klein <>
Reviewed-by: Josef Glatz <>
Reviewed-by: Andreas Fernandez <>

Revision e34c76db (diff)
Added by Georg Ringer about 1 month ago

[BUGFIX] Respect argument showLabel in AbstractButtonViewHelper

The argument `showLabel` must be used while creating a button.

Resolves: #88408
Releases: master, 9.5
Change-Id: I5bfcc25d03aac9da6ca11b651658749bf25d7bf1
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/60796
Tested-by: TYPO3com <>
Tested-by: Andreas Fernandez <>
Reviewed-by: Andreas Fernandez <>

History

#1 Updated by Georg Tiefenbrunn about 1 month ago

  • Related to Bug #85532: Convert backend user module to use view helpers for configuring module layout added

#2 Updated by Georg Ringer about 1 month ago

  • Category set to Backend API
  • Status changed from New to Accepted
  • Assignee set to Georg Ringer
  • Target version set to next-patchlevel
  • Complexity set to easy

#3 Updated by Gerrit Code Review about 1 month ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60789

#4 Updated by Gerrit Code Review about 1 month ago

Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60796

#5 Updated by Georg Ringer about 1 month ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

Also available in: Atom PDF