Skip to content

Fix the calendar exception to handle null #19691

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 1 commit into from
Closed

Fix the calendar exception to handle null #19691

wants to merge 1 commit into from

Conversation

wakqasahmed
Copy link
Contributor

Q A
Branch? 2.7, 2.8 and 3.1
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #19688
License MIT
Doc PR none

Fix the calendar exception to handle null, error was raised while exporting from akeneo

The Symfony\Component\Intl\DateFormatter\IntlDateFormatter::__construct() method's argument $calendar value NULL behavior is not implemented. Only the GREGORIAN calendar is supported. Please install the "intl" extension for full localization capabilities.

https://cloud.githubusercontent.com/assets/4486133/17287404/81f951cc-57e0-11e6-9f6f-e231bbf00bf4.png

Fix the calendar exception to handle null, error was raised while exporting from akeneo

The Symfony\Component\Intl\DateFormatter\IntlDateFormatter::__construct() method's argument $calendar value NULL behavior is not implemented. Only the GREGORIAN calendar is supported. Please install the "intl" extension for full localization capabilities.

https://cloud.githubusercontent.com/assets/4486133/17287404/81f951cc-57e0-11e6-9f6f-e231bbf00bf4.png
@jameshalsall
Copy link
Contributor

This PR should be targeted at 2.7 branch.

@@ -143,15 +143,15 @@ class IntlDateFormatter
* @see http://userguide.icu-project.org/formatparse/datetime
*
* @throws MethodArgumentValueNotImplementedException When $locale different than "en" or null is passed
* @throws MethodArgumentValueNotImplementedException When $calendar different than GREGORIAN is passed
* @throws MethodArgumentValueNotImplementedException When $calendar different than GREGORIAN is passed or null is passed
Copy link
Member

Choose a reason for hiding this comment

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

This change is wrong (no exception will be thrown when null is passed).
The docblock that needs to be changed is the @param above.

@nicolas-grekas
Copy link
Member

@wakqasahmed can you please add a test case? And ideally rebase on 2.7 also? (and change the base branch here on github as a consequence?)

@wakqasahmed
Copy link
Contributor Author

Submitted new PR (#19751) targeting branch 2.7 and having test case. Closing this one.

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.

4 participants