Project

General

Profile

Actions

Bug #91758

closed

OptgroupViewHelper uses wrong method to set disabled attribute

Added by M. Ecker over 3 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2020-07-07
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
10
PHP Version:
Tags:
Complexity:
no-brainer
Is Regression:
Sprint Focus:

Description

Using f:form.select.optgroup with attribute disabled="true" causes uncaught exception.

Reason:
TYPO3\CMS\Fluid\ViewHelpers\Form\Select\OptgroupViewHelper (line 46 in current master) calls
$this->tag->addAttributes('disabled', 'disabled')
instead of
$this->tag->addAttribute('disabled', 'disabled')

addAttributes expects array as first argument.

Solution:

        if ($this->arguments['disabled']) {
            $this->tag->addAttribute('disabled', 'disabled');
        } else {
            $this->tag->removeAttribute('disabled');
        }

or
        if ($this->arguments['disabled']) {
            $this->tag->addAttributes(['disabled'=>'disabled']);
        } else {
            $this->tag->removeAttribute('disabled');
        }


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #92656: Address Fluid view helper flawsClosed2020-10-21

Actions
Actions #1

Updated by Georg Ringer over 3 years ago

  • Status changed from New to Accepted
Actions #2

Updated by Gerrit Code Review over 3 years 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/+/65244

Actions #3

Updated by Georg Ringer over 2 years ago

  • Related to Bug #92656: Address Fluid view helper flaws added
Actions #4

Updated by Georg Ringer over 2 years ago

  • Status changed from Under Review to Closed

solved with #92656

Actions

Also available in: Atom PDF