[TYPO3-dev] TYPO3 CMS 6.1 Extbase Tx_Extbase_Persistence_ObjectStorage Bug

René Simon rene.simon at fox-lightware.de
Wed May 22 23:37:39 CEST 2013


Hello,

 

this is my first message in this list so I do not no know how many details I
have to write here.

 

I have a problem with CMS 6.1 and the extbase there.

 

To explain the problem I have to draw a little picture.

I  have a class where one attribute is a storage of frontend usergroups.

In one instance of this class in this storage is a frontend usergroup with
the uid 4.

 

Now there is a user which has among others the usergroup with the uid 4.

 

When I now check if the usergroups of the user contains the usergroup
instance 4 from the mentioned class, the response is false.

 

The reason is very simple. The class Tx_Extbase_Persistence_ObjectStorage
saves all object in an associated array. The key is the response of
spl_object_hash function when given the object to save as parameter.

The contains method just checks whether or not the key of the given objects
exists in the storage array.

For both usergroup instances spl_object_hash returns a different response
therefor the contains method did not work.

 

What I don’t understand is: Why are the instances different?

 

The same problem returns when I use the Tx_Extbase_Persistence_ObjectStorage
methods removeAll or addAll.

 

This is causing major problems in my extension.

 

Did someone has a hind or a solution for my problem?

 

Thanks in advance

René




More information about the TYPO3-dev mailing list