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

[PropertyInfo] DoctrineExtractor - There is bug when indexBy is meta key id #25834

Closed
insekticid opened this issue Jan 18, 2018 · 1 comment
Closed

Comments

@insekticid
Copy link
Contributor

insekticid commented Jan 18, 2018

There is bug when indexBy is meta key id introduced in doctrine pull
doctrine/orm#639
originally from issue
doctrine/orm#3094
doctrine/orm#1784

Buggy line is

$typeOfField = $subMetadata->getTypeOfField($indexProperty);

where $typeOfField = $subMetadata->getTypeOfField($indexProperty); returns null
-> $collectionKeyType = $this->getPhpType($typeOfField); returns null
-> return array(new Type(null) throws throw new \InvalidArgumentException(sprintf('"" is not a valid PHP type.', $builtinType));

I discoverred this bug when I attached Api Platform ApiLoader
https://github.com/api-platform/core/blob/master/src/Bridge/Symfony/Routing/ApiLoader.php#L108

nicolas-grekas added a commit that referenced this issue Apr 20, 2018
…rtyInfo\DoctrineExtractor (insekticid)

This PR was submitted for the 3.4 branch but it was merged into the 2.8 branch instead (closes #25841).

Discussion
----------

[DoctrineBridge] Fix bug when indexBy is meta key in PropertyInfo\DoctrineExtractor

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md files -->
| Tests pass?   | yes
| Fixed tickets | #25834 <!-- #-prefixed issue number(s), if any -->
| License       | MIT

@dunglas could you check it?
<!--
- Bug fixes must be submitted against the lowest branch where they apply
  (lowest branches are regularly merged to upper ones so they get the fixes too).
- Features and deprecations must be submitted against the master branch.
- Replace this comment by a description of what your PR is solving.
-->

Commits
-------

583759f PropertyInfo\DoctrineExtractor - There is bug when indexBy is meta key
@xabbuh
Copy link
Member

xabbuh commented May 3, 2018

fixed in #25841

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants