Actions
Bug #91656
closedMapping to sys_category is not working anymore in TYPO3 10
Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Extbase
Target version:
-
Start date:
2020-06-16
Due date:
% Done:
0%
Estimated time:
TYPO3 Version:
10
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:
Description
In TYPO3 9 I could extend sys_category in my extension by setting via TypoScript:
plugin.tx_myext.persistence { classes { MyNamespace\MyExt\Domain\Model\Category { mapping { recordType = 0 tableName = sys_category } } } }
And creating a model-file with
class Category extends \TYPO3\CMS\Extbase\Domain\Model\Category
And a repository-file with
class CategoryRepository extends \TYPO3\CMS\Extbase\Domain\Repository\CategoryRepository
After that I can use
$categoryRepository = $this->objectManager->get('MyNamespace\\MyExt\\Domain\\Repository\\CategoryRepository'); $oneCategory = $categoryRepository->findOneByUid(172);
This not working anymore with TYPO3 10. I get this error:
(1/3) #1472074485 TYPO3\CMS\Extbase\Persistence\Generic\Storage\Exception\SqlErrorException Table 'mydatabase.tx_myext_domain_model_category' doesn't exist
The mapping to sys_category is lost!
Is there another workaround?
Updated by Tobias Schmidt over 4 years ago
Persistence configuration needs to be done in PHP. Take a look at Breaking: #87623 - Replace config.persistence.classes typoscript configuration
Updated by Kurt Gusbeth over 4 years ago
OK, thanks, that works.
You can close this ticket.
Updated by Oliver Hader over 4 years ago
As a work-around you could try whether config.tx_extbase.persistence
works in TypoScript
Updated by Oliver Hader over 4 years ago
Ah nice... overlooked that there's already an answer... :)
Actions