When response contains only empty json array this results in an 'Undefined offset' notice

Created on 22 February 2023, over 1 year ago
Updated 17 March 2023, over 1 year ago

Problem/Motivation

When response contains only empty json array this results in an:

Notice: Undefined offset: 0 in Drupal\webform_remote_select\Plugin\WebformElement\WebformRemoteSelectElement->executeRequest() (line 303 of /var/www/html/web/modules/contrib/webform_remote_select/src/Plugin/WebformElement/WebformRemoteSelectElement.php)

Steps to reproduce

Configure Webform Remote Select to access an endpoint returning json like this: []

Proposed resolution

Provide additional check for an empty json array.

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇧🇪Belgium n3uronick

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

Comments & Activities

Production build 0.71.5 2024