Project

General

Profile

Actions

Bug #65689

closed

Type cast for BackendUtility::getLabelsFromItemsList()

Added by Georg Ringer about 9 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
Backend API
Target version:
Start date:
2015-03-12
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
7
PHP Version:
5.5
Tags:
Complexity:
easy
Is Regression:
No
Sprint Focus:

Description

Because of no strict comparison the mentioned method fails to get the correct value!

Example
EXT:news got the following TCA


'type' => array(
    'exclude' => 0,
    'label' => 'LLL:EXT:cms/locallang_tca.xlf:pages.doktype_formlabel',
    'config' => array(
        'type' => 'select',
        'items' => array(
            array($ll . 'tx_news_domain_model_news.type.I.0', 0),
            array($ll . 'tx_news_domain_model_news.type.I.1', 1),
            array($ll . 'tx_news_domain_model_news.type.I.2', 2),
        ),
        'size' => 1,
        'maxitems' => 1,
    )
),

the value of the items is an integer > 0,1,2

if someone extends the extension, like https://github.com/peterkraume/news_exampleextension which adds another type like @blogText", the core compares

the string "blogtext" vs the integer "0" which is TRUE.

As a solution: use a typecast

Actions #1

Updated by Gerrit Code Review about 9 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 http://review.typo3.org/37770

Actions #2

Updated by Gerrit Code Review about 9 years ago

Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/37781

Actions #3

Updated by Georg Ringer about 9 years ago

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

Updated by Riccardo De Contardi over 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF