ecamp3 icon indicating copy to clipboard operation
ecamp3 copied to clipboard

DoctrineExtension/Sortable bug: cannot handle doctrine proxies properly

Open usu opened this issue 3 years ago • 3 comments

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

usu avatar Aug 30 '22 18:08 usu

Is this still an issue?

BacLuc avatar Apr 27 '24 12:04 BacLuc

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.

usu avatar Apr 28 '24 05:04 usu

Core Meeting Decision

We would like to keep the Sortable and help DoctrineExtensions.

manuelmeister avatar May 15 '24 19:05 manuelmeister