-
-
Notifications
You must be signed in to change notification settings - Fork 829
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
Add symfony 3.0 support #752
Conversation
"type": "vcs", | ||
"url": "https://github.com/Ener-Getick/DunglasApiBundle.git" | ||
} | ||
], |
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.
Must be removed once api-platform/core#323 is merged.
ping @willdurand |
@Ener-Getick This is GREAT work, but your tests are failing:
Could you take a look at the tests please? Thanks! |
I will try to fix the remaining deprecations tomorrow, I didn't localize all of them yet. |
Not sure what you mean. I see lots of stable versions. |
Apparently this is fixed. A few minutes ago there were only the dev versions available. |
I fixed several errors but the behavior of the symfony forms seems to be changed in sf 3.0 and so the NelmioApiDocBundle behavior ... :/ |
@Ener-Getick why did you close this? We can find a solution for supporting the form behavior across multiple versions - SonataAdminBundle also had to support this problem. I would love for you to continue your nice work to completion! |
I didn't have any response so I thought you abandon. I'm not really involved in symfony core and in symfony/form so I don't know how we can fix this and why this behavior changed :-/ |
I'll try to help you with this after SymfonyCon (I.e. next week). Please ping me then if I forget about it. |
👍 @xabbuh And @Ener-Getick what are the problems that you're seeing? I noticed that you have the |
Thanks @xabbuh :-) @weaverryan the output of the formatters has changed (an example) I don't know why... I'll try to search again this week. But I'm wondering if it wouldn't be easier to split this PR because it introduces a lot of changes to test at the same time... |
Hmm, yea, I don't know about the formatting change - that is strange. If it's easier for you to split across multiple PR's and get things working, you could do that. But I don't think it's too hard for a reviewer to review. |
The problem is that I've made too many changes and I don't know when failures appeared... I'll create a new PR for everything already stable. Finally, I'll just revert the last changes of this PR to found when errors appeared. No need of a new PR ^^ |
There are already several errors with symfony 2.8 (see the build). I'll try to understand why this tests fail. |
->add('c1', $choiceType, array('choices' => array('m' => 'Male', 'f' => 'Female'), 'choices_as_values' => true)) | ||
->add('c2', $choiceType, array('choices' => array('m' => 'Male', 'f' => 'Female'), 'choices_as_values' => true, 'multiple' => true)) | ||
->add('c3', $choiceType, array('choices' => array())) | ||
->add('c4', $choiceType, array('choices' => array('foo' => 'bar', 'bazgroup' => array('baz' => 'Buzz')), 'choices_as_values' => true)) |
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 users will have to update their form with choices_as_values
if they want to use symfony 2.8 :/
The remaining errors seem unrelated to this PR. Needs review |
} else { | ||
throw new \InvalidArgumentException('Unsupported form type class.'); | ||
} | ||
} | ||
|
||
$name = array_key_exists('name', $item) ? $item['name'] : $form->getName(); |
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.
Form::getName has been removed from Symfony 3, use getBlockPrefix instead
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.
Thanks, this line is apparently not covered by the tests...
The But, that will also break the tests in 2.7 and lower. So in practice, we may need to add it in AppKernel, detect the Symfony version, and only add the asset key (this can be done via a closure) for 2.8 and higher. Nice job btw! |
You're welcome ;-) And yeah, see this. Can you relaunch Travis? Otherwise I'll do it tonight. |
@Ener-Getick that's what I did (triggering travis-ci again), but it is still failing... |
Yeah just see that dunglas/api-bundle is under 2.0.x-dev |
oh yes... @dunglas can we safely rely on |
No we can't but AFAIK the @Ener-Getick patch (thx for the good work) has been merged in |
I just discovered that packagist detects the branches named @dunglas could you rename your branch to |
I've just created a 1.1 branch (it's cleaner I think). It should work when #764 is merged. |
In fact renaming the |
It works thanks @dunglas |
awesome, thanks! |
Thanks a lot @Ener-Getick |
GG! |
Thank you 👍 1 Neal Street London WC2H 9QL www.rightster.com | @Rightster https://twitter.com/rightster | LinkedIn Rightster Limited (incorporated in England with company number 07634543) |
Awesome thank you all for your help |
I get this deprecation notice on Symfony 2.8:
This is because of the "alias" attribute here:
|
Hum this deprecation has probably been added later. I'll fix it this afternoon. |
Which version of the bundle do you use ? This should not trigger a deprecation see here |
@Ener-Getick You're right. It must be caused by another bundle then... (The way deprecation warnings are logged is pretty unhelpful.) |
@teohhanhui you can open an issue in symfony/symfony if a deprecation warning isn't clear enough - it's pretty common that many can be improved to contain more information (in this case, if the service id were in the message, that would help a lot). |
@teohhanhui v2.11.1 is released and contains @Ener-Getick's fix. |
I forgot to specify, it's a fix for a deprecation triggered in the tests not in production :x |
@Ener-Getick yep, but it documents how to fix this deprecation :) |
Uhh, yes. I rechecked and it turns out I was using |
👍 |
This PR adds symfony 3.0 support.