Skip to content
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

getEntityChangeset not working with ODM #1263

Open
garak opened this issue Jan 24, 2022 · 4 comments
Open

getEntityChangeset not working with ODM #1263

garak opened this issue Jan 24, 2022 · 4 comments

Comments

@garak
Copy link
Collaborator

garak commented Jan 24, 2022

Bug Report

Q A
BC Break no
Bundle version 1.19

Summary

Method getEntityChangeset introduced in dbfe95c exists only for ORM.
For ODM, the method is getDocumentChangeset

@Sander-Toonen
Copy link

Is this related to #1277 ?

@mcitdev
Copy link

mcitdev commented Apr 1, 2022

Hi @garak
Is there any updates on this?

A quick workaround:

Vich\UploaderBundle\EventListener\Doctrine\CleanListener.php

CleanListener::preUpdate(EventArgs $event)
`

  $changeSet = [];

  if($event instanceof \Doctrine\ODM\MongoDB\Event\PreUpdateEventArgs) {

      $changeSet = $event->getDocumentChangeSet();

  }

  elseif ($event instanceof \Doctrine\ORM\Event\PreUpdateEventArgs) {

      $changeSet = $event->getEntityChangeSet();

  }

`

@garak
Copy link
Collaborator Author

garak commented Apr 1, 2022

@mcitdev unfortunately there's a bigger problem, see #1252
So the idea now is to revert the change made in 1.19 and go back to the same we had in 1.18

@mcitdev
Copy link

mcitdev commented Apr 1, 2022

@garak ok, I see.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants