Comments (2)
It seems related to isInIdentityMap
, and there is two occurences https://github.com/search?q=repo%3Asonata-project%2FEntityAuditBundle+isInIdentityMap&type=code
I think we're passing the old data and the new data so without any more information, I would think you are passing string
instead of object
to one of your oTo/oTm/mTo/mTm relations.
from entityauditbundle.
I suspect that array_merge in the LogRevisionsListener::postUpdate() function (https://github.com/sonata-project/EntityAuditBundle/blob/1.12.0/src/EventListener/LogRevisionsListener.php#L246) provides an unexpected result for those entities which primary keys include a foreign key/relationship to another entity (which is our case with ProductCompany entity)
i have dumped data of each of the three arrays that are being merged there:
$this->getOriginalEntityData($em, $entity)
$uow->getEntityIdentifier($entity),
$this->getManyToManyRelations($em, $entity)
values from $uow->getEntityIdentifier($entity) override those from $this->getOriginalEntityData($em, $entity), so the resulting array is
in which the 'product' and 'company' entities have been replaced with only their ids
later this causes the 'spl_object_id() expects parameter 1 to be object, string given' TypeError in the LogRevisionsListener::saveRevisionEntityData() function (https://github.com/sonata-project/EntityAuditBundle/blob/1.12.0/src/EventListener/LogRevisionsListener.php#L522) where function \Doctrine\ORM\UnitOfWork::isInIdentityMap($entity) recieves 'PN0002624' in the $entity parameter, instead of the expected Product entity (the same would then happen for the 'PSP' string in place of the expected Company entity)
i think we are saving our entities correctly and this is an oversight in EntityAuditBundle related to primary keys composed of foreign keys (similar to #502)
from entityauditbundle.
Related Issues (20)
- What happened to this project? It is transfer to `sonata-project`. HOT 4
- Audit tables are being generated for all entities, not just the ones specified in config HOT 3
- Support Annotations HOT 4
- Compare Revision (`CompareAction`) route not working HOT 11
- Identical Dates should not create a revision HOT 2
- Integration with EasyAdminBundle ? HOT 5
- Argument 3 passed to SimpleThings\EntityAudit\Revision::__construct() must be of the type string, null given HOT 3
- The "security.token_storage" service or alias has been removed or inlined when the container was compiled. HOT 1
- Extending revision entity/table. HOT 1
- Auditing an entity which uses foreign key as primary key fails HOT 2
- Ignore fields option not working HOT 8
- Support for translatable entities HOT 1
- Many To Many audit relation fail with new entity in the relation. HOT 9
- View changes not showing HOT 1
- Support for `doctrine/collections` ^2.0 HOT 1
- Incompatible with Lazy-Loading Proxies (Ghost)? HOT 10
- Doctrine ORM 3 support HOT 2
- Ignore related tables for auditiong HOT 2
- Multiple many-to-many relationships to same table causes DUPLICATE KEY error.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from entityauditbundle.