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
FatalThrowableError when calling 'getDocComment()' if value is null #437
Comments
I get the same exception but with another case. The Another point to add is that I don't want JMS to parse these choices, since I don't have any "key" and only values, but
Here's the code: $builder
->add('activated', ChoiceType::class, array(
'choices' => array(
'1',
'0',
'inherited'
),
'choices_as_values' => true,
))
; Here's the stack:
EDIT: After applying, @Jarown 's modifications, it worked like a charm. Could you make a PR with them? (For the time being I'll just use a personal fork) |
Expected behavior
translation:extract
does not result in fatal errorsActual behavior
translation:extract
throws this fatal in the described situation below[Symfony\Component\Debug\Exception\FatalThrowableError] Call to a member function getDocComment() on null
Steps to reproduce
Run for attached files:
bin/console translation:extract en --bundle=MyBundle
Steps to reproduce
It looks like the items in the 'choices'-array cause this error. The attached patch fixes the fatal by checking first if
value
is an object, before calling the function.FatalThrowableError.patch.txt
StatisticsTrackingHelper.php.txt
MyApiFormType.php.txt
The text was updated successfully, but these errors were encountered: