Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[DoctrineBridge] LockStoreSchemaListener not working properly #54406

Copy link
Copy link
Closed
@barton-webwings

Description

@barton-webwings
Issue body actions

Symfony version(s) affected

6.4.4

Description

After installing symfony/lock and configuring it with DoctrineDbalStore, I noticed that invoking doctrine:migrations:diff command would generate a migration issuing a DROP of the autogenerated lock_keys table.

After investigating, I found out the issue is line 33 of the listener. The $stores property receives a RewindableGenerator, which is then passed directly to an ArrayIterator. This produces an invalid iterator, skipping the whole following while loop.

How to reproduce

  1. Configure symfony/lock with a DoctrineDbalStore.
  2. Generate the lock_keys table, either by using the LockFactory or by any other means mentioned in the docs.
  3. Run the doctrine:migrations:diff command.
  4. See that the the schema for the table is not properly configured, resulting in a migration instead of the expected No changes detected in your mapping information. message.

Possible Solution

Since the $stores property is already typed as iterable, it would seem replacing the loop with a foreach iterating directly on the property would be the best solution.

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.