-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
ReferencesListener not calling preUpdate #1152
Comments
In addition I tested events via
And This also happens without the |
It really looks like a bug: doctrine/DoctrineMongoDBBundle#230 supposed to be fixed in and commented by @jmikola in this answer asked by @lazycommit . |
Yep, got the same problem here. |
@webdevilopers, @steffenbrem: Can you confirm if doctrine/mongodb-odm#985 fixes this issue? |
Is that PR doctrine/mongodb-odm#985 in I couldn't find any other branch for https://github.com/doctrine/mongodb-odm/milestones/1.0.0-BETA13. |
@webdevilopers: Yes, that commit would be in master. I'll make a note in doctrine/mongodb-odm#861 that this still is not fixed. |
@webdevilopers could you see if doctrine/mongodb-odm#1121 (it's not merged yet) will solve the issue? |
Will try tomorrow @malarzm ! |
I copied your UnitOfWork.php file into my current setup (#1152 (comment)) but still the |
@webdevilopers could you by any chance create a failing test case and PR it to ODM? It would help a lot with debugging |
I will give it a try tomorrow! At the bottom line it's just an assert that the field changed in the |
@webdevilopers yes. Also one thing that came to my mind, are you calling |
No @malarzm , havn't tried that yet. Before creating a general Test for PR here is a version for my related app: The second test Simply updating the Hope this helps? Where exactely in my test should I add your suggested method? $documentManager->getUnitOfWork()->recomputeSingleDocumentChangeSet(
'Plusquam\Bundle\TimekeepingBundle\Document\Payroll', $payroll);
$documentManager->persist($payroll);
$documentManager->flush(); |
@webdevilopers oh I think ODM is behaving correctly, you are updating only |
But also please note that I don't know how |
Good advice, @malarzm ! I will follow the discussion on the Gedmo Extension on other issues e.g.: Indeed the ODM itself works fine. This issue is really related to the gedmo reference listener. |
This problem exists until now. |
The workaround is exactly what you wrote: update a field the ODM is aware of so it can trigger a |
Since there still seems to be an issue with the
orm
andodm
config for theReferencesListener
- see #821 - I only have configured theodm
this way:My
Payroll
Document is linkend to aBranch
Entity:I can successfully create a new Document with the Entity relation. But I can't update it:
I added some output to the ReferencesListener methods:
The
prePersist
is called but never thepreUpdate
.Is a different service config required to make it work for updating?
The text was updated successfully, but these errors were encountered: