[FLOW3-general] Persisting objects with array properties

Florian Kugler mail at floriankugler.de
Wed Oct 20 16:11:57 CEST 2010


Hi all,

today I tried the first time to incorporate the persistence framework, which worked fine until I tried to persist an object which has an array property. 
The property gets initialized with an empty array during a setup action and then gets persisted. But when I retrieve the object again from the repository (during a different request) and insert something into this array property, persistAll fails because in Persistence/Backend/GenericPdo/Backend.php removeDeletedArrayEntries() will be called with $previousArray = NULL. 

The following change to Persistence/Backend/GenericPdo/Backend.php on line 346 fixes this problem, but at this moment I have no idea if it creates new ones ;)

old: if ($previousArray !== NULL) {
new: if (($previousArray !== NULL) && ($previousArray['value'] !== NULL)) {

Anybody experienced this problem?

Thanks,
Florian



More information about the FLOW3-general mailing list