8000 [Form] [DoctrineBridge] added a failing test for EntityType by ianfp · Pull Request #15328 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Form] [DoctrineBridge] added a failing test for EntityType #15328

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

Closed
wants to merge 4 commits into from

Conversation

ianfp
Copy link
@ianfp ianfp commented Jul 21, 2015
Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? sometimes *
Fixed tickets none
License MIT
Doc PR none

This is a new test for EntityType that uses an entity whose primary key is a foreign key to
another entity (an "association key"), as described here:

http://doctrine-orm.readthedocs.org/en/latest/tutorials/composite-primary-keys.html#identity-through-foreign-entities

Using the entity form type with an association-key entity used to work before 2.7, so I believe this is a BC break.

Update: I've added a possible fix to the IdReader class in the latest commit. I don't know if it is the right fix, but...

* I say the tests pass "sometimes" because Symfony\Component\HttpKernel\Tests\HttpCache\HttpCacheTest is failing intermittently, and I don't think it is related to my change.

@ianfp
Copy link
Author
ianfp commented Jul 21, 2015

Hi @stof, I'd like to bring this pull request to your attention. It isn't passing the tests because it isn't intended to -- it consists of a new test whose failure exposes what I believe is a BC-breaking bug. Is this an okay thing to do?

Update: I've just committed a possible fix.

@ianfp
Copy link
Author
ianfp commented Aug 11, 2015

Hi @stof, @webmozart, could I trouble one of you to look at this pull request? I believe it is a BC break introduced in 2.7.

I'm pretty confident in that the tests I added are correctly exposing the problem, but I'm not at all confident that my proposed fix is the best solution. Your feedback would be much appreciated.

@ianfp ianfp force-pushed the entity_type_assoc_key branch from 5b0f992 to 587e409 Compare August 27, 2015 15:49
@ianfp
Copy link
Author
ianfp commented Aug 27, 2015

Update: it seems that someone else committed a fix for the same problem, so I've removed my conflicting code. This PR now amounts to just an added test case.

@fabpot
Copy link
Member
fabpot commented Sep 14, 2015

👍


$this->persist(array($single, $assoc));

$field = $this->factory->createNamed('name', 'entity', null, array(
Copy link
Contributor

Choose a reason for hiding this comment

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

"entity" needs to be replaced by the entity form type FQCN

Copy link
Contributor

Choose a reason for hiding this comment

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

hm, actually that only needs to be changed in 2.8 where this has been deprecated. So the merger would need to make the changes.

@Tobion
Copy link
Contributor
Tobion commented Sep 15, 2015

Please rebase on current 2.7 to see if tests really pass after the above changes.

@ianfp ianfp force-pushed the entity_type_assoc_key branch from 587e409 to 046f1e8 Compare September 15, 2015 16:35
@jakzal
Copy link
Contributor
jakzal commented Sep 30, 2015

@ianfp do you have time to finish this one? nvm. This seems to be ready.

@jakzal
Copy link
Contributor
jakzal commented Sep 30, 2015

status: reviewed

@xabbuh
Copy link
Member
xabbuh commented Sep 30, 2015

I think this has been fixed in the meantime by #15251.

@ianfp Thank you anyway for fixing this bug and please feel free to reopen in case you disagree.

@xabbuh xabbuh closed this Sep 30, 2015
@ianfp
Copy link
Author
ianfp commented Sep 30, 2015

@xabbuh While you are correct that #15251 is the bugfix, this is the missing test. So I think this PR should be reopened. (I can't see how to reopen it.)

@xabbuh
Copy link
Member
xabbuh commented Sep 30, 2015

@ianfp #15251 also contains a test. Please let me know if you still disagree. :)

@ianfp
Copy link
Author
ianfp commented Sep 30, 2015

@xabbuh Oops! You're right. This one can stay closed.

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

Successfully merging this pull request may close these issues.

6 participants
0