Undefined index classname in DataMapper method mapSingleObject
|Priority:||Must have||Due date:|
|Assignee:||Karsten Dambekalns||% Done:||
|Target version:||TYPO3 Flow Base Distribution - 1.0 alpha 8|
|Has patch:||FLOW3 version affected:|
When the same object is referenced more than once in the data retrieved from database, the classname field is just set once, the second and subsequent references only return an identifier, fine if the order used to map the properties is the same, which cannot be guaranteed because the properties list is returned by reflection.
An exemple to make it clear:
A class named Link has two properties fromCondition and toCondition that reference the same object. The data array used to map the object Link has a classname value only for fromCondition.
If in the Link class definition fromCondition property preceeds toCondition property definition, everything is fine.
If the order of properties is reversed, the error is thrown.
Possible fixes could consist in always returning a classname value from database when returning multiple references to the same object or ensuring the properties are always persisted and mapped back to object in the same order.
IMHO depending on properties in fixed order should not be considered.
Bug occurs on xampp for windows 1.7.3 with FLOW3 alpha7, with default sqlite persistence backend. Didn't try it with a MySql backend.
Hope I made it clear enough.
Updated by Karsten Dambekalns over 3 years ago
- Status changed from New to Accepted
- Assignee set to Karsten Dambekalns
Updated by Karsten Dambekalns about 3 years ago
- Status changed from Accepted to Needs Feedback
Could you check the latest SVN version to see if it fixes your problem? Thanks!
Updated by Alexandre Martinez about 3 years ago
Works a charm for me. Tested each combination of properties and everything is OK. Nice job. Thanks!