Bug #80399

Extended CategoryRegistry is loaded from cached tca with core CategoryRegistry class name

Added by Marc Bastian Heinrichs almost 4 years ago. Updated 10 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Categorization API
Target version:
-
Start date:
2017-03-22
Due date:
% Done:

100%

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

Description

While implemeting a solution for #53045, I run into the problem, that registering the unserialized CategoryRegistry singleton is done with the core class name and not the extended name.

Idea for a quick solution in ExtensionManagementUtility::loadBaseTca

- GeneralUtility::setSingletonInstance(CategoryRegistry::class, $cacheData['categoryRegistry']);
+ if (!is_a($cacheData['categoryRegistry'], CategoryRegistry::class)) {
+    throw ...
+ }
+ GeneralUtility::setSingletonInstance(get_class($cacheData['categoryRegistry']), $cacheData['categoryRegistry']);

To reproduce register a "empty" extended CategoryRegistry

$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][\TYPO3\CMS\Core\Category\CategoryRegistry::class] = array(
    'className' => \MyVendor\TestExtension\Category\CategoryRegistry::class
);

Notice with a cached tca the category field element in menu types categorized_pages or categorized_content is not allowed anymore.

#1

Updated by Gerrit Code Review 11 months ago

  • Status changed from New to Under Review

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/63618

#2

Updated by Gerrit Code Review 11 months ago

Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/63586

#3

Updated by Benni Mack 11 months ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
#4

Updated by Benni Mack 10 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF