Project

General

Profile

Actions

Bug #54289

closed

Using Tx_Extbase_Persistence_ObjectStorage doesn't work in rewritten PropertyMapper

Added by Stefan Froemken over 10 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Extbase
Target version:
Start date:
2013-12-09
Due date:
% Done:

100%

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

Description

Hello Extbase-Team,

I have a model with a MM relation to Categories. As this extension was programmed in TYPO3 4.7 I use the old names Tx_Extbase_Persistence_ObjectStorage, but on creating the record extbase throws an Exception:

Current GIT Version: 09.12.2013

Exception while property mapping at property path "categories":Class Tx_Extbase_Persistence_ObjectStorage<Tx_JwCategories_Domain_Model_Category> does not exist

I also have tested this issue with TYPO3 6.1:

Exception while property mapping at property path "categories":No converter found which can be used to convert from "array" to "Tx_Extbase_Persistence_ObjectStorage".

So this problem seems to be in full TYPO3 6.* tree.

@Thomas: Hint: There is no getEarlyInstance() method in TYPO3 < 6.2


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #65472: TYPO3 6.2.10 Extbase Type Converter can't resolve Tx_Extbase_Persistence_ObjectStorageClosed2015-03-03

Actions
Actions #1

Updated by Stefan Froemken over 10 years ago

  • Project changed from 534 to TYPO3 Core
  • Category deleted (Extbase: Property)
  • Assignee set to Thomas Maroschik
  • Priority changed from Should have to Must have

Moved to Core

Actions #2

Updated by Helmut Hummel over 10 years ago

  • Is Regression set to No
  • TYPO3 Version set to 6.2

Stefan Froemken wrote:

Exception while property mapping at property path "categories":Class Tx_Extbase_Persistence_ObjectStorage<Tx_JwCategories_Domain_Model_Category> does not exist

This looks like a space is missing between collection type Tx_Extbase_Persistence_ObjectStorage and object type <Tx_JwCategories_Domain_Model_Category>

Actions #3

Updated by Helmut Hummel over 10 years ago

  • Status changed from New to Needs Feedback
Actions #4

Updated by Stefan Froemken over 10 years ago

A space is missing?!?! In my last 4 years with extbase I have never seen and needed a space between ObjectStorage and Subclass. I just have debugged this part and both types were extracted successful.

Actions #5

Updated by Marc Bastian Heinrichs over 10 years ago

  • Assignee deleted (Thomas Maroschik)
  • Priority changed from Must have to Should have
  • Complexity deleted (easy)

Without space should be correct. Which mapper do you use?

The rewritten property mapper strips away everthing with beginning "<" and there is a typeconverter from array to Tx_Extbase_Persistence_ObjectStorage in 4.7.
And never had issues with the old property mapper and ObjectStorages.

Actions #6

Updated by Marc Bastian Heinrichs over 10 years ago

  • Assignee set to Stefan Froemken
Actions #7

Updated by Marc Bastian Heinrichs over 10 years ago

  • Category set to Extbase
  • Status changed from Needs Feedback to Accepted
  • Assignee deleted (Stefan Froemken)
  • Priority changed from Should have to Must have

After reading the code it seems that property mapper only know the namespaced ObjectStorage as target type.
So this bug should be fixed.

Actions #8

Updated by Marc Bastian Heinrichs over 10 years ago

  • Subject changed from Using old class names does not work in new PM for $targetType to Using Tx_Extbase_Persistence_ObjectStorage doesn't work in rewritten PropertyMapper
Actions #9

Updated by Frans Saris over 10 years ago

Think I found the source of the problem. \TYPO3\CMS\Extbase\Property\PropertyMapper::findFirstEligibleTypeConverterInObjectHierarchy() doesn't return the right converter.

As Tx_Extbase_Persistence_ObjectStorage is a alias for \TYPO3\CMS\Extbase\Persistence\ObjectStorage the class_parents() doesn't return the wanted results.
You would think \TYPO3\CMS\Extbase\Persistence\ObjectStorage is a parent of Tx_Extbase_Persistence_ObjectStorage but with alias class that doesn't work that way.

The problem can be solved by using the original name instead of the alias.

Adding the following to the top of findFirstEligibleTypeConverterInObjectHierarchy() resolves the problem here. But I'm uncertain if this location is the right location. Maby it should be checked earlier in the chain.

    $targetClass = \TYPO3\CMS\Core\Core\ClassLoader::getClassNameForAlias($targetClass);
Actions #10

Updated by Gerrit Code Review over 10 years ago

  • Status changed from Accepted to Under Review

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

Actions #11

Updated by Helmut Hummel over 10 years ago

Frans Saris wrote:

Think I found the source of the problem. \TYPO3\CMS\Extbase\Property\PropertyMapper::findFirstEligibleTypeConverterInObjectHierarchy() doesn't return the right converter.

As Tx_Extbase_Persistence_ObjectStorage is a alias for \TYPO3\CMS\Extbase\Persistence\ObjectStorage the class_parents() doesn't return the wanted results.
You would think \TYPO3\CMS\Extbase\Persistence\ObjectStorage is a parent of Tx_Extbase_Persistence_ObjectStorage but with alias class that doesn't work that way.

The problem can be solved by using the original name instead of the alias.

What I do not understand is, that is worked in 6.0.

Any idea what broke for 6.2 or 6.1?

Actions #12

Updated by Helmut Hummel over 10 years ago

Helmut Hummel wrote:

What I do not understand is, that is worked in 6.0.

Any idea what broke for 6.2 or 6.1?

Hm, at least I think it worked...

Actions #13

Updated by Gerrit Code Review about 10 years ago

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/26578

Actions #14

Updated by Gerrit Code Review about 10 years ago

Patch set 1 for branch TYPO3_6-1 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27262

Actions #15

Updated by Gerrit Code Review about 10 years ago

Patch set 2 for branch TYPO3_6-1 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27262

Actions #16

Updated by Frans Saris about 10 years ago

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

Updated by Riccardo De Contardi over 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF