Project

General

Profile

Actions

Bug #91656

closed

Mapping to sys_category is not working anymore in TYPO3 10

Added by Kurt Gusbeth almost 4 years ago. Updated almost 4 years 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?

Actions #1

Updated by Tobias Schmidt almost 4 years ago

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

Actions #2

Updated by Kurt Gusbeth almost 4 years ago

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

Actions #3

Updated by Oliver Hader almost 4 years ago

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

Actions #4

Updated by Oliver Hader almost 4 years ago

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

Actions #5

Updated by Oliver Hader almost 4 years ago

  • Status changed from New to Closed
Actions

Also available in: Atom PDF