#012108: ezcPersistentStateTransformer::rowToStateArray() relying on definitions with reverse properties set, but it's not automatic

Description:

Fetching an object isn't possible if $ezcPersistentDefinitionManager->setupReversePropertyDefinition wasn't called on the definition object because ezcPersistentStateTransformer::rowToStateArray() relies on the reverse properties.

Why isn't ezcPersistentStateTransformer::rowToStateArray() checking if reverse properties are set and, call setupReversePropertyDefinition() by itself ?


Environment:

eZC trunk version.


- Attachments

No attachments for this issue.


- Comments

This happens when the definition was Not loaded through fetchDefinition(), which might make this more like an enhancement than a bug as Larson suggested.

Larson suggested as well that protected : ezcPersistentDefinitionManager::setupReversePropertyDefinition() could be made public and that : $ezcPersistentObjectDefinition->__get( 'columns' ) checks if the reverse properties are set up, in order to do it if required, thus preventing the exception.

Larson's suggestion might speed up the code since reverse-properties aren't used when saving an object : there is no-need for them in some cases.

#254897 by James Pic on November 28th, 2007 [Permanent Link]

Discussions on IRC turned out the following: Adding a check to __get( 'columns' ) will add much more overhead than the current implementation has for cases where persistent objects are only stored and not loaded. Therefore this idea will be discarded.

Since ezcPersistentDefinitionManager is the correct place to perform the reverse setup it will be kept there and more documentation on this will be added to the affected classes. In addtion a check for correctly initialized reverse-lookup will be added to ezcPersistentStateTransformer::rowToStateArray() and an exception will be thrown if it is missing.

#255341 by Tobias Schlitt on January 7th, 2008 [Permanent Link]

Fixed in rev. #7096 (stable/PersistentObject/1.3 and trunk).

#255342 by Tobias Schlitt on January 7th, 2008 [Permanent Link]

- History
Properties
Type Bug
Priority Medium
Component Components » PersistentObject
Affects Unknown
Fix Version 2007.2.1 - eZ components 2007.2.1
Reporter James Pic
Responsible Tobias Schlitt
Status 0 Closed
Resolution Fixed
Created November 28th, 2007
Updated January 7th, 2008
Resolved January 7th, 2008
 
Navigation [Permanent Link]
Previous Issue
Back to Issues List
Next Issue: #015537
  Graph shows to small and truncated rotated axis labels