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

TableMetadataStorage - fix isAlreadyV3Format for the same version values #1466

Merged

Conversation

kfrankiewicz
Copy link
Contributor

@kfrankiewicz kfrankiewicz commented Oct 24, 2024

Q A
Type bug
BC Break no
Fixed issues no link, the explanation below

Summary

Doctrine\Migrations\Metadata\Storage\TableMetadataStorage::isAlreadyV3Format() method was returning false even if both versions in the arguments have exactly the same value. E.g.:

       strpos(
            'Namespace\Version1234',
            'Namespace\Version1234'
        ) !== (
                strlen('Namespace\Version1234') -
                strlen('Namespace\Version1234')
            );

Compares 0 !== 0 what gives false, but isAlreadyV3Format() should return true when the versions are the same.

Copy link
Member

@SenseException SenseException left a comment

Choose a reason for hiding this comment

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

Thank you.

I'd expect a test that covers the fixed behaviour.

@kfrankiewicz
Copy link
Contributor Author

@SenseException Thanks for asking for the test. There was an issue! I've added the test.

@greg0ire
Copy link
Member

greg0ire commented Nov 6, 2024

It seems there are CI jobs failing. Please take a look at this guide for more on how to handle those.

@kfrankiewicz
Copy link
Contributor Author

Done @greg0ire. Hope I haven't missed anything more.

@greg0ire greg0ire added this to the 3.8.3 milestone Nov 12, 2024
@greg0ire greg0ire merged commit 13b2364 into doctrine:3.8.x Nov 12, 2024
12 checks passed
@greg0ire
Copy link
Member

Thanks @kfrankiewicz

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.

3 participants