-
-
Notifications
You must be signed in to change notification settings - Fork 261
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
Fix connection for doctrine event tag #363
Fix connection for doctrine event tag #363
Conversation
@phansys |
Sure, I'll try to check this later. |
I think this is working, at least in the test environment: wbloszyk#1. |
@phansys |
Co-authored-by: Javier Spagnoletti <[email protected]>
|
||
foreach ($tags as $attributes) { | ||
if (isset($attributes['connection'])) { | ||
$attributes['connection'] = (string) $container->getParameter('simplethings.entityaudit.connection'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO, if we harcode the parameter name here, we are making less flexible the replacing mechanism.
If in the future the parameter name used in these tags is renamed, we must replace this occurrence too.
I also think that the final users could not override these services if they need to use a different value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We set this simplethings.entityaudit.connection
parameter in the same SimpleThingsEntiyAuditExtension
, so I think we do not have to afriaid about rename. Additionaly if users override this service then connection name must be set directly, oherwise expection will be throw.
We can also move it to the compiler pass. Then we can check whole services tagged by doctrine.event_listener
and replace simplethings.entityaudit.connection
parameter in connetion
to propertly value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
symfony/symfony#40262
WDYT? @sonata-project/contributors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure to understand, should we wait for symfony/symfony#40262 or can we merge this ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can merge this now. This code allow use param only for ower services.we can remove this code when symfony accept it and we bump doctrine-bridge.
Also they can accept it as feature and merge it in 5.2 version.
Subject
After #355 I got some errors like:
It look like doctrine event tag will not convert parameter name into value. This PR will replace this parameter name into value.
I am targeting this branch, because this change respect BC.
Changelog is not needed becouse we do not release #355 yet.