It's hard to explain in words what the issue is exactly, so i have attached a module directory which reproduces the issue.
Basically i have an action that defines an array with objects (for example with id's 1,2,3 and 4) for use in the template.
The template calls a partial multiple times and supplies the array with objects as a parameter.
That partial iterates through the objects and calls another partial, with one of the objects in the array as a parameter.
The first time that we iterate through the objects, all is fine... i get objects 1,2,3 and 4.
However, after calling the partial again, and again... the array contains objects: 4,2,3 and 4
In the partials themselves, nothing really happens that could alter the array with the objects.
I was able to fix this for my project, by changing the renderFile() in sfPHPView. instead of using:
extract($this->attributeHolder->toArray(), EXTR_REFS);
i use
extract($this->attributeHolder->toArray(), EXTR_OVERWRITE);
And the array with objects retains the objects with id 1,2,3 and 4
I'm not sure if this is the right way to fix this, maybe someone with better knowledge about the core files and the View classes can look into this.
This issue only occurred to me when calling partials from partials multiple times.