DoctrineExtension/Sortable bug: cannot handle doctrine proxies properly
DoctrineExtension/Sortable triggers an error when rootContentNode is configured with orphanRemoval:true
#[ORM\OneToOne(targetEntity: ColumnLayout::class, cascade: ['persist'], orphanRemoval: true)]
#[ORM\JoinColumn(nullable: false, unique: true)]
public ?ColumnLayout $rootContentNode = null;
Bug is registered in upstream repo: https://github.com/doctrine-extensions/DoctrineExtensions/issues/2510
Workaround currently implemented in https://github.com/ecamp/ecamp3/pull/2825/commits/22231efa27c74ea042c93fd3689cd934739e6385:
- no automatic orphanRemoval
- in data persisters, rootContentNodes are now manually loadend + removed (when deleting Activity, Category or Camp)
Sustainable solution:
- fix bug in upstream
- or get rid of Sortable
Is this still an issue?
I think the issue still exists as the upstream bug is not resolved. I haven't tested though.
Currently, we have implemented a workaround in 3 places (ActivityRemoveProcessor, CategoryRemoveProcessor, CampRemoveProcessor). As these workarounds are working, we could also close the issue here.
Currently, DoctrineExtension blocks us from upgrading to ORM v3. So it might be worth another discussion, if we want to stick with DoctrineExtenion as a dependency.
Core Meeting Decision
We would like to keep the Sortable and help DoctrineExtensions.