Bug #70034
closedProblem with makeCategorizable in TYPO3 6.2.15
0%
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
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
Updated by Stephan Großberndt about 9 years ago
- Status changed from New to Needs Feedback
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.
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
orext_tables.php
as described here: https://docs.typo3.org/typo3cms/CoreApiReference/ApiOverview/Categories/Index.htmlThe 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
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.