Bug #91656

Mapping to sys_category is not working anymore in TYPO3 10

Added by Kurt Gusbeth over 1 year ago. Updated over 1 year ago.

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?

#1

Updated by Tobias Schmidt over 1 year ago

Persistence configuration needs to be done in PHP. Take a look at Breaking: #87623 - Replace config.persistence.classes typoscript configuration

#2

Updated by Kurt Gusbeth over 1 year ago

OK, thanks, that works.
You can close this ticket.

#3

Updated by Oliver Hader over 1 year ago

As a work-around you could try whether config.tx_extbase.persistence works in TypoScript

#4

Updated by Oliver Hader over 1 year ago

Ah nice... overlooked that there's already an answer... :)

#5

Updated by Oliver Hader over 1 year ago

  • Status changed from New to Closed

Also available in: Atom PDF