-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[DoctrineBridge] LockStoreSchemaListener not working properly #54406
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
Comments
Same issue in 7.0, seems the PR to fix a niche case use of the lock component has broken functionality. |
Just spent some time finding out why LockStoreSchemaListener does not work in 6.4 before coming here. Is there a chance the existing PR will get merged into 6.4 (or will the changes that cause this reverted for 6.4)? |
@uwej711 this seems unlikely given the confusion #50761 have caused: it broke the |
For anyone finding this issue until it is resolved, I can share one of the ways you can work around this. https://gist.github.com/barton-webwings/4ddf9446d0c640d44fe41880202e0105 |
…Cat) This PR was squashed before being merged into the 6.4 branch. Discussion ---------- [DoctrineBridge] Fix the `LockStoreSchemaListener` | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | Fix #54406 | License | MIT #54407 got sidetracked ~and `@barton`-webwings seems no longer active on GitHub~ so this PR takes over. Commits ------- db070a1 [DoctrineBridge] Fix the `LockStoreSchemaListener`
Symfony version(s) affected
6.4.4
Description
After installing
symfony/lock
and configuring it withDoctrineDbalStore
, I noticed that invokingdoctrine:migrations:diff
command would generate a migration issuing aDROP
of the autogeneratedlock_keys
table.After investigating, I found out the issue is line 33 of the listener. The
$stores
property receives aRewindableGenerator
, which is then passed directly to anArrayIterator
. This produces an invalid iterator, skipping the whole followingwhile
loop.How to reproduce
symfony/lock
with aDoctrineDbalStore
.lock_keys
table, either by using theLockFactory
or by any other means mentioned in the docs.doctrine:migrations:diff
command.No changes detected in your mapping information.
message.Possible Solution
Since the
$stores
property is already typed asiterable
, it would seem replacing the loop with aforeach
iterating directly on the property would be the best solution.Additional Context
No response
The text was updated successfully, but these errors were encountered: