From e0ebca6d02d99ecf55a6f442b039d29f0d43d665 Mon Sep 17 00:00:00 2001 From: Waqas Ahmed Date: Sun, 21 Aug 2016 07:32:59 +0400 Subject: [PATCH] Fix the calendar exception to handle null 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 --- .../Component/Intl/DateFormatter/IntlDateFormatter.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/Intl/DateFormatter/IntlDateFormatter.php b/src/Symfony/Component/Intl/DateFormatter/IntlDateFormatter.php index 7dcb58b289b39..51b5cd054815f 100644 --- a/src/Symfony/Component/Intl/DateFormatter/IntlDateFormatter.php +++ b/src/Symfony/Component/Intl/DateFormatter/IntlDateFormatter.php @@ -143,7 +143,7 @@ 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 */ public function __construct($locale, $datetype, $timetype, $timezone = null, $calendar = self::GREGORIAN, $pattern = null) { @@ -151,7 +151,7 @@ public function __construct($locale, $datetype, $timetype, $timezone = null, $ca throw new MethodArgumentValueNotImplementedException(__METHOD__, 'locale', $locale, 'Only the locale "en" is supported'); } - if (self::GREGORIAN !== $calendar) { + if (self::GREGORIAN !== $calendar && null !== $calendar) { throw new MethodArgumentValueNotImplementedException(__METHOD__, 'calendar', $calendar, 'Only the GREGORIAN calendar is supported'); }