Skip to content
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 registering PdoSessionHandlerSchemaSubscriber #1623

Conversation

alli83
Copy link
Contributor

@alli83 alli83 commented Jan 24, 2023

nicolas-grekas added a commit to symfony/symfony that referenced this pull request Jan 29, 2023
…rSchemaSubscriber (alli83)

This PR was merged into the 6.3 branch.

Discussion
----------

[HttpFoundation] inject SessionHandler in PdoSessionHandlerSchemaSubscriber

| Q             | A
| ------------- | ---
| Branch?       | 6.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| License       | MIT
| Doc PR        |  I'm working on it

following the PR #48059.

In #48059, it works only if you put the handler explicitly to PdoSessionHandler in the configuration (handler_id) but it stops working if the session is defined by the factory and we can't use it as follow:
````
handler_id: '%env(resolve:DATABASE_URL)%'
`````

Linked to DoctrineBundle PR doctrine/DoctrineBundle#1623

Also imho, I think the second argument of configureSchema inPdoSessionHandler should be optional and set to return true if not defined  since the function is public eg. one wants to add the table to the Schema.

Commits
-------

9aded06 [HttpFoundation] inject SessionHandler in PdoSessionHandlerSchemaSubscriber
symfony-splitter pushed a commit to symfony/http-foundation that referenced this pull request Jan 29, 2023
…rSchemaSubscriber (alli83)

This PR was merged into the 6.3 branch.

Discussion
----------

[HttpFoundation] inject SessionHandler in PdoSessionHandlerSchemaSubscriber

| Q             | A
| ------------- | ---
| Branch?       | 6.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| License       | MIT
| Doc PR        |  I'm working on it

following the PR symfony/symfony#48059.

In symfony/symfony#48059, it works only if you put the handler explicitly to PdoSessionHandler in the configuration (handler_id) but it stops working if the session is defined by the factory and we can't use it as follow:
````
handler_id: '%env(resolve:DATABASE_URL)%'
`````

Linked to DoctrineBundle PR doctrine/DoctrineBundle#1623

Also imho, I think the second argument of configureSchema inPdoSessionHandler should be optional and set to return true if not defined  since the function is public eg. one wants to add the table to the Schema.

Commits
-------

9aded06c0c [HttpFoundation] inject SessionHandler in PdoSessionHandlerSchemaSubscriber
@alli83 alli83 force-pushed the doctrine-bundle-update-config-pdo-session-handler-schema-subscriber branch 3 times, most recently from 04eb966 to c9962bc Compare January 30, 2023 14:08
@nicolas-grekas nicolas-grekas changed the title [DoctrineBundle] fix: Tagged_iterator to identify and inject in PdoSessionHandlerSchemaSubscriber Fix registering PdoSessionHandlerSchemaSubscriber Jan 31, 2023
@nicolas-grekas nicolas-grekas force-pushed the doctrine-bundle-update-config-pdo-session-handler-schema-subscriber branch from c9962bc to a7dc269 Compare January 31, 2023 17:50
@nicolas-grekas nicolas-grekas force-pushed the doctrine-bundle-update-config-pdo-session-handler-schema-subscriber branch from a7dc269 to 7536dc6 Compare January 31, 2023 17:52
Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ready on my side (I updated the PR)

@ostrolucky
Copy link
Member

If this is a fix, shouldn't it go to 2.8.x?

@alli83
Copy link
Contributor Author

alli83 commented Jan 31, 2023

It's a fix for #1569. if I'm not wrong it has been merged on 2.9. I let @nicolas-grekas confirm it :)

@ostrolucky ostrolucky added this to the 2.9.0 milestone Jan 31, 2023
@ostrolucky ostrolucky added the Bug label Jan 31, 2023
@ostrolucky ostrolucky merged commit d7cd358 into doctrine:2.9.x Jan 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants