Comments (4)
@dvdknaap
auditor
relies on Doctrine changesets to keep track of what was added/updated/deleted/associated/dissociated.When several
onFlush
subscribers are registered (which is the case here, there are at least 2 subscribers:auditor
's one and yours), if subscribers alter entities and try to persist them but do not explicitly tell Doctrine to update the computed changeset, then changes applied by one subscriber may not/won't be available/visible to other subscribers.This is discussed in Doctrine documentation
Changing primitive fields or associations requires you to explicitly trigger a re-computation of the changeset of the affected entity. This can be done by calling $unitOfWork->recomputeSingleEntityChangeSet($classMetadata, $entity).
Do you explicitly trigger a re-computation of the changeset in your subscriber?
Hi, thanks for your reply.
I know i'm using unit of works recomputeSingleEntityChangeSet function to tell doctrine there is an change.
I found the issue apparently is unitOfWork is getting new data from the database and triggers postLoad (Events::postLoad) which makes the data readable again because it's an select query so i have to find a way to manual do this so unitOfWork doesn't see a change everytime.
Now it also updating different 'encrypted' entity colomns because it's comparing it with the plain text value that postLoad provided it so this issue it not in your code but in doctrine because of this i shall close this issue
from auditor.
@dvdknaap did you solve your issue on your own?
from auditor.
@DamienHarper
Hadn't test the priority setting yet but it's still not working unfortionatly :(
services.yaml
App\EventSubscriber\EncryptSubscriber:
tags:
- name: 'doctrine.event_subscriber'
priority: 9999
But in the database it still gives plain text.
{"new":"5yTc8wChiQyTEXi1MtOO5A==","old":"testName"}
"old" should have a base64 string
from auditor.
@dvdknaap auditor
relies on Doctrine changesets to keep track of what was added/updated/deleted/associated/dissociated.
When several onFlush
subscribers are registered (which is the case here, there are at least 2 subscribers: auditor
's one and yours), if subscribers alter entities and try to persist them but do not explicitly tell Doctrine to update the computed changeset, then changes applied by one subscriber may not/won't be available/visible to other subscribers.
This is discussed in Doctrine documentation
Changing primitive fields or associations requires you to explicitly trigger a re-computation of the changeset of the affected entity. This can be done by calling $unitOfWork->recomputeSingleEntityChangeSet($classMetadata, $entity).
Do you explicitly trigger a re-computation of the changeset in your subscriber?
from auditor.
Related Issues (20)
- Add whitelist option to audit columns HOT 2
- Incorrect primary key name on render HOT 2
- Deprecation of Doctrine\DBAL\Logging\SQLLogger Interface HOT 3
- Linking changes in child entities to their parent entity HOT 1
- BackedEnum could not be converted to int HOT 1
- Json column is double encoded HOT 3
- exception while creating audit table schema when using single table inheritance HOT 8
- Laravel support HOT 1
- Error on upgrading symfony 6.2 HOT 20
- Breaking Change in PR#137 HOT 1
- Attempted to call an undefined method named "introspectSchema" of class "Doctrine\DBAL\Schema\PostgreSQLSchemaManager" HOT 1
- How to define a storage mapper? HOT 4
- Deprecation spam HOT 11
- UTF-8 Character Encoding fails in TransactionProcessor HOT 1
- 2.4.4 broke enum compatibility HOT 2
- Laminas Framework HOT 1
- Warning: mb_convert_encoding(): Object is not supported HOT 2
- Make DoctrineODM / MongoDB compatible?
- Custom columns and custom data in the audit tables
- Example use statement shown for Auditing Configuration in Docs Undefined HOT 1
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 auditor.