system_time_zones() is deprecated in drupal:10.1.0

Created on 17 August 2023, over 1 year ago
Updated 22 August 2023, over 1 year ago

Problem/Motivation

When unit testing the DateRecurBasicWidgetTest.php, we are geting an error as follows:

21x: system_time_zones() is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. This function is no longer used in Drupal core. Use \Drupal\Core\Datetime\TimeZoneFormHelper::getOptionsList(), \Drupal\Core\Datetime\TimeZoneFormHelper::getOptionsListByRegion() or \DateTimeZone::listIdentifiers() instead. See https://www.drupal.org/node/3023528

Steps to reproduce

Run the test ddev exec vendor/bin/phpunit -c core modules/contrib/date_recur/tests/src/Functional/DateRecurBasicWidgetTest.php

Proposed resolution

Use TimeZoneFormHelper::getOptionsList() instead of system_time_zones()

🐛 Bug report
Status

Closed: won't fix

Version

3.4

Component

Code

Created by

🇮🇳India mukhtarm

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024