Project

General

Profile

Actions

Bug #76141

closed

Problem with !empty() in makeCategorizable usage

Added by Patrick Kroog almost 8 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
-
Target version:
-
Start date:
2016-05-11
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
8
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

Steps to face this bug:

- Add a TCA-Definition for a table with 2 or more "types".
- Try to ONLY add the category field to the first type, which is type "0" (using makeCategorizable and use "typesList" in option Array...)
For example:

// Add an extra categories selection field to the pages table
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::makeCategorizable(
    'eventmanager',
    'tx_eventmanager_domain_model_event',
    'category',
    array(
        'typesList' => '0',
        'label' => 'LLL:EXT:eventmanager/Resources/Private/Language/locallang_db.xlf:tx_eventmanager_domain_model_event.category',
        'exclude' => true,
        'fieldConfiguration' => array(
           ...
           )
        ),
        'l10n_mode' => 'exclude',
        'l10n_display' => 'hideDiff',
    )
);

The typesList is now ignored, and the category field is added to ALL types as TYPO3\CMS\Core\Category\CategoryRegistry::addToAllTCAtypes checks the typesList option like this:

            $typesList = '';
            if (!empty($options['typesList'])) {
                $typesList = $options['typesList'];
            }

So, as a workaround one could use a typesList like this, but as it's not documented, one wouldn't understand why the default configuration doesn't work:

// Add an extra categories selection field to the pages table
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::makeCategorizable(
    'eventmanager',
    'tx_eventmanager_domain_model_event',
    'category',
    array(
        'typesList' => '0,999',
        'label' => 'LLL:EXT:eventmanager/Resources/Private/Language/locallang_db.xlf:tx_eventmanager_domain_model_event.category',
        'exclude' => true,
        'fieldConfiguration' => array(
           ...
           )
        ),
        'l10n_mode' => 'exclude',
        'l10n_display' => 'hideDiff',
    )
);

So this check should be corrected!

Actions #1

Updated by Patrick Kroog almost 8 years ago

Sorry, short info about bug is missing:

Can't add category field with makeCategorizable only to "type" -> "0"

Actions #2

Updated by Gerrit Code Review almost 8 years ago

  • Status changed from New 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/48364

Actions #3

Updated by Gerrit Code Review almost 8 years ago

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

Actions #4

Updated by Gerrit Code Review almost 8 years ago

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

Actions #5

Updated by Gerrit Code Review almost 8 years ago

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

Actions #6

Updated by Gerrit Code Review almost 8 years ago

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

Actions #7

Updated by Gerrit Code Review almost 8 years ago

Patch set 1 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/48386

Actions #8

Updated by Wouter Wolters almost 8 years ago

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

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF