PHP 8: Deprecated function errors for strtoupper(), trim()

Created on 6 December 2022, over 2 years ago
Updated 28 September 2023, over 1 year ago

When I display a view with location fields on PHP 8, I get several errors:

Deprecated function: strtoupper(): Passing null to parameter #1 ($string) of type string is deprecated in location_handler_field_location_country->render() (line 42 of /var/www/drupal/sites/all/modules/contrib/location/handlers/location_handler_field_location_country.inc).

Deprecated function: trim(): Passing null to parameter #1 ($string) of type string is deprecated in location_standardize_country_code() (line 670 of /var/www/drupal/sites/all/modules/contrib/location/location.inc).

Deprecated function: strtoupper(): Passing null to parameter #1 ($string) of type string is deprecated in location_province_name() (line 627 of /var/www/drupal/sites/all/modules/contrib/location/location.inc).

Deprecated function: strtoupper(): Passing null to parameter #1 ($string) of type string is deprecated in location_handler_field_location_country->render() (line 42 of /var/www/drupal/sites/all/modules/contrib/location/handlers/location_handler_field_location_country.inc).

Deprecated function: trim(): Passing null to parameter #1 ($string) of type string is deprecated in location_standardize_country_code() (line 670 of /var/www/drupal/sites/all/modules/contrib/location/location.inc).

Deprecated function: strtoupper(): Passing null to parameter #1 ($string) of type string is deprecated in location_province_name() (line 627 of /var/www/drupal/sites/all/modules/contrib/location/location.inc).

Deprecated function: strtoupper(): Passing null to parameter #1 ($string) of type string is deprecated in location_handler_field_location_country->render() (line 42 of /var/www/drupal/sites/all/modules/contrib/location/handlers/location_handler_field_location_country.inc).

Deprecated function: trim(): Passing null to parameter #1 ($string) of type string is deprecated in location_standardize_country_code() (line 670 of /var/www/drupal/sites/all/modules/contrib/location/location.inc).

Deprecated function: strtoupper(): Passing null to parameter #1 ($string) of type string is deprecated in location_province_name() (line 627 of /var/www/drupal/sites/all/modules/contrib/location/location.inc).
🐛 Bug report
Status

RTBC

Version

3.0

Component

Code

Created by

🇩🇪Germany ronino

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024