8000 [DoctrineBridge] Param as connection in `*.event_subscriber/listener` tags by wbloszyk · Pull Request #40262 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[DoctrineBridge] Param as connection in *.event_subscriber/listener tags #40262

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

Merged
merged 1 commit into from
Oct 30, 2021

Conversation

wbloszyk
Copy link
Contributor
@wbloszyk wbloszyk commented Feb 20, 2021
Q A
Branch? 5.x
Bug fix? no
New feature? yes
Deprecations? no
Tickets Fix #40260
License MIT
Doc PR -

It can be consider as bug, becouse using %param% is allowing in configuration, but can not be use in tag.
It can be consider as feaure becouse tag should be provide by compiller pass.

@carsonbot
Copy link

Hey!

I see that this is your first PR. That is great! Welcome!

Symfony has a contribution guide which I suggest you to read.

In short:

  • Always add tests
  • Keep backward compatibility (see https://symfony.com/bc).
  • Bug fixes must be submitted against the lowest maintained branch where they apply (see https://symfony.com/releases)
  • Features and deprecations must be submitted against the 5.x branch.

Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change.

When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor!
If this PR is merged in a lower version branch, it will be merged up to all maintained branches within a few days.

I am going to sit back now and wait for the reviews.

Cheers!

Carsonbot

@nicolas-grekas
Copy link
Member

This would be a new feature to me.
But now I'm wondering why this isn't handled by ResolveParameterPlaceHoldersPass.
Can you please give it a try?

@nicolas-grekas nicolas-grekas removed the Bug label May 7, 2021
@nicolas-grekas nicolas-grekas modified the milestones: 4.4, 5.x May 7, 2021
@wbloszyk wbloszyk changed the base branch from 4.4 to 5.4 August 23, 2021 17:12
@chalasr
Copy link
Member
chalasr commented Sep 26, 2021

@wbloszyk friendly ping :) Do you plan to update this PR according to Nicolas' suggestion?

@wbloszyk
Copy link
Contributor Author

@wbloszyk friendly ping :) Do you plan to update this PR according to Nicolas' suggestion?

Thanks for pinging. I really forgot about it. I will check it tomorrow.

For first look IT look like it is should be handler by ResolveParameterPlaceHoldersPass or even more probably by AbstractRecursivePass.

@wbloszyk
Copy link
Contributor Author

@chalasr
I have not more time for this now. I analyse code and this is results:

Problem description
Can not use parameter as argument in tag, example:

<tag name="doctrine.event_subscriber" connection="%simplethings.entityaudit.connection%"/>

Will throw

The Doctrine connection "%simplethings.entityaudit.connection%" referenced   
!!    in service "simplethings_entityaudit.log_revisions_listener" does not exist  
!!    . Available connections names: "default".   

Description
While running RegisterEventListenersAndSubscribersPass for doctrine-bridge argument connection is not resolve.

Sugestion

  • ResolveParameterPlaceHoldersPass - is dedicated for service attributes, arguments and methodCalls.
  • RegisterEventListenersAndSubscribersPass is call before ResolveTaggedIteratorArgumentPass
  • ResolveTaggedIteratorArgumentPass - do not work correctly
  • RegisterEventListenersAndSubscribersPass - do not work correctly or arguments are resolve correctly but compilerPass does not see it.

@nicolas-grekas nicolas-grekas changed the title [doctrine-bridge] Param as connection in *.event_subscriber/listener tags Param as connection in *.event_subscriber/listener tags Sep 29, 2021
@carsonbot carsonbot changed the title Param as connection in *.event_subscriber/listener tags [DoctrineBridge] Param as connection in *.event_subscriber/listener tags Sep 29, 2021
@nicolas-grekas
Copy link
Member

Can you please add an entry in the changelog of the component?

@fabpot
Copy link
Member
fabpot commented Oct 30, 2021

Thank you @wbloszyk.

This was referenced Nov 5, 2021
@wbloszyk wbloszyk deleted the issue_40260 branch November 5, 2021 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

40FD [doctrine-bridge] Allow using param as connection name in tags
6 participants
0