timezone_identifiers_list_cache is null in olson_from_tzstring
AWL: 0.64 Davical: 1.1.13
I get this exception when trying to load events from Davical:
TypeError: in_array(): Argument #2 ($haystack) must be of type array, null given in /usr/share/awl/inc/AWLUtilities.php:635
Stack trace:
#0 /usr/share/awl/inc/AWLUtilities.php(635): in_array()
#1 /usr/share/davical/inc/RRule.php(44): olson_from_tzstring()
#2 /usr/share/davical/inc/RRule.php(218): RepeatRuleTimeZone->__construct()
#3 /root/git/calendar/bundle/CalendarBundle/Service/EventMapper.php(635): RepeatRuleDateTime->__construct()
#4 /root/git/calendar/bundle/CalendarBundle/Service/EventMapper.php(176): asdfasdf\CalendarBundle\Service\EventMapper->getDate()
#5 /root/git/calendar/bundle/CalendarBundle/Service/FeedProvider.php(113): asdfasdf\CalendarBundle\Service\EventMapper->convertEvent()
#6 /root/git/calendar/bundle/CalendarBundle/Service/FeedProvider.php(79): asdfasdf\CalendarBundle\Service\FeedProvider->mapVComponentToArray()
#7 /root/git/calendar/bundle/CalendarBundle/Controller/FeedController.php(66): asdfasdf\CalendarBundle\Service\FeedProvider->getMultiEvents()
#8 /root/git/vendor/web/vendor/symfony/http-kernel/HttpKernel.php(163): asdfasdf\CalendarBundle\Controller\FeedController->multiFeed()
#9 /root/git/vendor/web/vendor/symfony/http-kernel/HttpKernel.php(75): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
#10 /root/git/vendor/web/vendor/symfony/http-kernel/Kernel.php(202): Symfony\Component\HttpKernel\HttpKernel->handle()
#11 /usr/share/asdfasdf/web/public/app.php(28): Symfony\Component\HttpKernel\Kernel->handle()
#12 {main}
The function olson_from_tzstring uses the global $timezone_identifiers_list_cache which is not initialised.
$timezone_identifiers_list_cache = timezone_identifiers_list();
$timezone_identifiers_list_cache = isset($timezone_identifiers_list_cache) ? $timezone_identifiers_list_cache : [];
/**
* Try and extract something like "Pacific/Auckland" or "America/Indiana/Indianapolis" if possible.
*/
function olson_from_tzstring( $tzstring ) {
global $c, $timezone_identifiers_list_cache;
if ( in_array($tzstring,$timezone_identifiers_list_cache) ) return $tzstring;
I guess since the AWLUtilities.php script is not require_once() the global has not been initialised?