-
Notifications
You must be signed in to change notification settings - Fork 66
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
[Form] Fix DocumentType #193
Conversation
$loader = function (Options $options) use ($type) { | ||
$qb = $options['query_builder'] ?: $options['em']->createQueryBuilder()->fromDocument($options['class'], 'a'); | ||
|
||
return $type->getLoader($options['em'], $qb, $options['class']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is essentially what every version of symfony since 2.3 is doing, so should not be needed to overwrite this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay, i solved that mistery. @guilhermeblanco fixed this 10 day ago! symfony/symfony@529d99c - that commit is not yet in a 2.3 release.
should we still do this to work with older versions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but it will get into 2.3? if we do not duplicate the method which versions of Symfony2 will not be supported? if we do keep this method, we should add a note about when we can remove the method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is now in 2.3.27 - but either we would need to up our minimal requirement to that symfony version (and also somehow avoid 2.6 < 2.6.6) or we could see if we can do a version check at this point and explode if the version is not new enough. or only overwrite if we are on a too old version of symfony. not sure what is best and the most elegant?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
imho increasing the min version or setting conflicts are the way to go. less code to maintain for us.
08bcad6
to
1035776
Compare
@@ -40,7 +40,8 @@ | |||
"burgov/key-value-form-bundle": "to edit assoc multivalue properties. require version 1.0.*" | |||
}, | |||
"conflict": { | |||
"phpcr/phpcr-shell": "<1.0.0-beta1" | |||
"phpcr/phpcr-shell": "<1.0.0-beta1", | |||
"symfony/framework-bundle": ">=2.6.0,<2.6.6" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this the correct way to specify we conflict with 2.6 versions < 2.6.6 but 2.3.27 is ok?
what about 2.4 and 2.5? should we start to conflict with those?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did 2.4 and 2.5 get the fix? I assume not?
in this case maybe just do the following in the require: ~2.3.27,~2.6
updated. what should we do about the query builder? just hope it does not matter for now and go with the direct find? |
28a69b1
to
ab5032f
Compare
ab5032f
to
5373efc
Compare
@@ -18,7 +18,7 @@ | |||
"minimum-stability": "dev", | |||
"require": { | |||
"php": ">=5.3.3", | |||
"symfony/framework-bundle": "~2.3", | |||
"symfony/framework-bundle": "~2.3.27 || ~2.6.6 || ~2.7", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we drop compatibility with 2.4 and 2.5 as they are not fixed.
i also updated the .travis.yml to not attempt to build those versions.
btw, ,
means AND, ||
means OR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok cool
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but why do we need 2.3.27+ / 2.6.6+ ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah .. because of the fixes to the DoctrineType I guess
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the build failure looks strange .. otherwise +1 to merge |
5373efc
to
073c728
Compare
i now allow 2.7 to fail - has nothing to do with this pull request - i just started adding 2.7. i now added a functional test - however, that test does not fail even with older versions of symfony. it seems, so i am not sure i got things right. |
073c728
to
0dc969b
Compare
hm, and even when 2.6.6 is used, the blog thing still fails: https://travis-ci.org/symfony-cmf/BlogBundle/jobs/56075966 will need to investigate some more to figure out what we do differently there than in the test here. |
so merge this? |
i never managed to make my tests fail. however, the BlogBundle still always fails, even with a recent enough version. there must be something i miss. lets wait with merging until i figured out what is happening, maybe we do not need the restrictions on symfony versions as they are proposed here. |
@duanesteel find a solution for our Sylius ContentBundle problem and it seems this involve the Is this a proper fix or a workaround ? |
0dc969b
to
5373efc
Compare
ok, i dug through this and its not exactly nice. symfony older than 2.6.6 did not build a the other issue is EntityChoiceList::getChoicesForValues that tried to do a query i looked into workarounds for the older symfony versions, but the way the choiceList is built in DoctrineType is extremely inconvenient to customize. so i think we need to bump the minimal version to 2.6.6 |
5373efc
to
a3ca595
Compare
ok, i think i got it right now. including actually respecting the query builder if there is one provided. @psyray may i ask you to check one more time if this works as expected now? |
The |
@psyray yep, this branch. i changed what is in this fix to respect the query builder if its supplied. |
Seems to work in Sylius with Symfony 2.3.27 |
we still have build failures. 5.3 needs more memory and there is some regression with 2.7 |
2786126
to
832dc84
Compare
yeah 2.7 seems to render a less nice html for forms. i made the test assumptions more flexible. for the lowest deps, i try to remove the memory limit. problem is that composer on 5.3 consumes a lot more memory than on other platforms so when there are many options of versions to compare it explodes. if it does not work, we could try 5.3 instead of 5.3.3 or stop building on 5.3 @lsmith77 do you think this can be released as bugfix release once merged? |
env: SYMFONY_VERSION=2.7.* SYMFONY_DEPRECATIONS_HELPER=weak | ||
|
||
before_install: | ||
- composer self-update || true | ||
- echo 'memory_limit = -1' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this needs to be conditional, does not work for the hhvm build
…that fixed DoctrineType
832dc84
to
7782dda
Compare
The Tested in my own project too which is in 2.6.6 👍 |
@psyray 1.2.4 has been released -> https://github.com/doctrine/DoctrinePHPCRBundle/releases/tag/1.2.4 |
great, thanks for the job 👍 |
while working on symfony-cmf/blog-bundle#59 and hunting down the last test failure, i found that the phpcr_document form type did not work but throw exceptions.
i also noticed that there is no test for this form type, neither functional nor unit.