SOAP handler errors without conditions set

Created on 13 June 2023, about 1 year ago
Updated 17 May 2024, about 1 month ago

Problem/Motivation

Adding a SOAP handler results in a PHP error if you do not have any conditions on the handler.

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

Steps to reproduce

Add a SOAP handler and attempt to save it without setting any conditions. The "states" array will end up being NULL and the handler will crash.

Proposed resolution

Wrap L144 of the SoapWebformHandler in a conditional that checks if the states array exists. For example:

    // Cleanup states.
    if (is_array($values['states'])) {
      $values['states'] = array_values(array_filter($values['states']));
    }

Or perhaps that line can be removed altogether since it does not appear in the REST handler and cleaning up the states array is something you might expect webform to handle by itself.

🐛 Bug report
Status

Fixed

Version

3.0

Component

Code

Created by

🇳🇿New Zealand dieuwe Auckland, NZ

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

Merge Requests

Comments & Activities

Production build 0.69.0 2024