Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Fix indexBy type extraction#20051

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fabpot merged 1 commit intosymfony:2.8fromlemoinem:fix/index-by-type-extraction
Sep 28, 2016

Conversation

lemoinem
Copy link
Contributor

@lemoinemlemoinem commentedSep 24, 2016
edited
Loading

QA
Branch?2.8+
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed ticketsN/A
LicenseMIT
Doc PRN/A

Bug found and patched by@ksom

Since3008228, the Doctrine Bridge's PropertyInfo Extractor tries to extract the type of the key in an indexed association. However, as you can see in3008228#diff-7a8fb8072d57f95ea6e37898b05895bcR91, the extractor was using the metadata of the class containing the association instead of the target entity's metadata to retrieve the type of the index.

The tests were green because in3008228#diff-c7e914ed89ceffd939733efe08c039c2R44, the property used toindexBy was present in the classes on both sides of the relation with the same type.

Once the test is fixed (by renaming the property in the targetEntity), the test provided at3008228#diff-1b2e044d1df011c00caf802a07895bdbR88 gives the error

1) Symfony\Bridge\Doctrine\PropertyInfo\Tests\DoctrineExtractorTest::testExtract with data set #9 ('indexedBar', array(Symfony\Component\PropertyInfo\Type Object (...)))InvalidArgumentException: "" is not a valid PHP type.

The fix is to fetch the metadata of the target entity and check there for the property type.

ksom and ogizanagi reacted with thumbs up emoji
@lemoinemlemoinem changed the base branch frommaster to2.8September 24, 2016 21:44
@lemoinem
Copy link
ContributorAuthor

The travis build failed because of an issue with the LDAP test (src/Symfony/Component/Ldap/Tests/Fixtures/data/base.ldif: No such file or directory) which occurs in the HHVM environment.

@ksom
Copy link

ksom commentedSep 25, 2016
edited
Loading

@lemoinem Thanks for mentioning me :)

@fabpot
Copy link
Member

Thank you@lemoinem.

@fabpotfabpot merged commit138c6e3 intosymfony:2.8Sep 28, 2016
fabpot added a commit that referenced this pull requestSep 28, 2016
This PR was merged into the 2.8 branch.Discussion----------Fix indexBy type extraction| Q             | A| ------------- | ---| Branch?       | 2.8+| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets | N/A| License       | MIT| Doc PR        | N/ABug found and patched by@ksomSince3008228, the Doctrine Bridge's PropertyInfo Extractor tries to extract the type of the key in an indexed association. However, as you can see in3008228#diff-7a8fb8072d57f95ea6e37898b05895bcR91, the extractor was using the metadata of the class containing the association instead of the target entity's metadata to retrieve the type of the index.The tests were green because in3008228#diff-c7e914ed89ceffd939733efe08c039c2R44, the property used to `indexBy` was present in the classes on both sides of the relation with the same type.Once the test is fixed (by renaming the property in the targetEntity), the test provided at3008228#diff-1b2e044d1df011c00caf802a07895bdbR88 gives the error    1) Symfony\Bridge\Doctrine\PropertyInfo\Tests\DoctrineExtractorTest::testExtract with data set#9 ('indexedBar', array(Symfony\Component\PropertyInfo\Type Object (...)))    InvalidArgumentException: "" is not a valid PHP type.The fix is to fetch the metadata of the target entity and check there for the property type.Commits-------138c6e3 Fix indexBy type extraction
@lemoinemlemoinem deleted the fix/index-by-type-extraction branchSeptember 28, 2016 02:21
This was referencedOct 3, 2016
@teohhanhui
Copy link
Contributor

Oops! Thanks for catching this. 👍

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

5 participants
@lemoinem@ksom@fabpot@teohhanhui@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp