Project

General

Profile

Actions

Bug #70034

closed

Problem with makeCategorizable in TYPO3 6.2.15

Added by Krzysztof Kasprzyca about 9 years ago. Updated about 9 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
-
Target version:
-
Start date:
2015-09-23
Due date:
% Done:

0%

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

Description

Hello

I have problem with my extension "amt_feed_importer". I use 'makeCategorizable' function in TCA configuration (file Configuration/TCA/Feed.php) for 'categories' field. In TYPO3 6.2.14 everything works fine but if I change version to 6.2.15 the tree is not available. Should it work like this and problem is on my side or not? I think it could be related with #67881

I attached actual code of my extension


Files

amt_feed_importer.zip (99.3 KB) amt_feed_importer.zip Krzysztof Kasprzyca, 2015-09-23 08:18

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #67881: CategoryRegistry is empty when TCA is read from cacheClosedAlexander Stehlik2015-07-02

Actions
Actions #1

Updated by Alexander Stehlik about 9 years ago

Hy Krzysztof,

thank you for your report.

I think you are using the makeCategorizable() call in the wrong file.

Please use it in TCA/Overrides/Feed.php or ext_tables.php as described here: https://docs.typo3.org/typo3cms/CoreApiReference/ApiOverview/Categories/Index.html

The second way is to call \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::makeCategorizable(). This method adds a new entry into the registry managed by \TYPO3\CMS\Core\Category\CategoryRegistry. The registry will take care of adding the relevant $TCA definition to create a field for making relations to the system categories. The call to makeCategorizable() must be located in an extension's ext_tables.php file or (since TYPO3 CMS 6.2.1) in a file from the Configuration/TCA/Overrides folder.

I hope this helps.

Cheers,
Alex

Actions #2

Updated by Stephan Großberndt about 9 years ago

  • Status changed from New to Needs Feedback
Actions #3

Updated by Robert Dickhaut about 9 years ago

Its seems like a user error.

ext_tables.php

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::makeCategorizable(
    $_EXTKEY,
    '...._domain_model_feed'
);

----
TCA no edit needed - no category or something else - TYPO3 do it self
----
Domain/Model/Feed.php
    /**
     * Categories
     *
     * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\Category>
     */
    protected $categories = NULL;

    /**
     * Returns the categories
     *
     * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\Category> $categories
     */
    public function getCategories() {
        return $this->categories;
    }

    /**
     * Sets the categories
     *
     * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\Category> $categories
     * @return void
     */
    public function setCategories(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $categories) {
        $this->categories = $categories;
    }

It works for me fine in 6.2 - so please try my code.

Hope it help you.
Robert.

Actions #4

Updated by Krzysztof Kasprzyca about 9 years ago

Alexander Stehlik wrote:

Hy Krzysztof,

thank you for your report.

I think you are using the makeCategorizable() call in the wrong file.

Please use it in TCA/Overrides/Feed.php or ext_tables.php as described here: https://docs.typo3.org/typo3cms/CoreApiReference/ApiOverview/Categories/Index.html

The second way is to call \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::makeCategorizable(). This method adds a new entry into the registry managed by \TYPO3\CMS\Core\Category\CategoryRegistry. The registry will take care of adding the relevant $TCA definition to create a field for making relations to the system categories. The call to makeCategorizable() must be located in an extension's ext_tables.php file or (since TYPO3 CMS 6.2.1) in a file from the Configuration/TCA/Overrides folder.

I hope this helps.

Cheers,
Alex

Thanks Alex, of course it helps

Actions #5

Updated by Wouter Wolters about 9 years ago

  • Status changed from Needs Feedback to Closed

As I read your message you found your solution. I'll close this issue now.

Actions

Also available in: Atom PDF