Skip to content

[Sortable] processDeletion fails if $object is a proxy #2510

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
usu opened this issue Aug 30, 2022 · 1 comment
Open

[Sortable] processDeletion fails if $object is a proxy #2510

usu opened this issue Aug 30, 2022 · 1 comment
Labels
Bug A confirmed bug in Extensions that needs fixing. Sortable Still Relevant Mark PRs that might've been auto-closed that are still relevant.

Comments

@usu
Copy link

usu commented Aug 30, 2022

Objects registered for deletion in the UOW can be non-initalized proxies.

In this case the $position property read in processDeletion returns null:
https://github.com/doctrine-extensions/DoctrineExtensions/blob/main/src/Sortable/SortableListener.php#L518
$position = $meta->getReflectionProperty($config['position'])->getValue($object);

This will create invalid SQL statements in updatePositions.

Should we use EntityWrapper to initialize proxies and load values from entities/proxies?

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the Stale label Feb 26, 2023
@phansys phansys added Sortable Still Relevant Mark PRs that might've been auto-closed that are still relevant. Bug A confirmed bug in Extensions that needs fixing. and removed Stale labels Mar 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A confirmed bug in Extensions that needs fixing. Sortable Still Relevant Mark PRs that might've been auto-closed that are still relevant.
Projects
None yet
Development

No branches or pull requests

2 participants