TypeError: array_filter(): Argument #1 ($array) must be of type array, null given in array_filter

Created on 9 May 2023, over 1 year ago

Problem/Motivation

getting this error on Drupal 10.

TypeError: array_filter(): Argument #1 ($array) must be of type array, null given in array_filter()

Steps to reproduce

  • Install the module on Drupal 10
  • Navigate to the Twilo settings configuration page. (/admin/config/system/twilio)
  • without saving the Twilo settings configuration navigate to send test sms page. (/admin/config/system/twilio/test)
  • you will get a website encounter error.

Proposed resolution

$settings = \Drupal::config('twilio.settings')->get('twilio_country_codes_container')['country_codes'];

to

$settings = \Drupal::config('twilio.settings')->get('twilio_country_codes_container')['country_codes'] ?? [];

🐛 Bug report
Status

Closed: duplicate

Component

Code

Created by

🇮🇳India omkar_yewale Mumbai

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

Comments & Activities

Production build 0.71.5 2024