foreach() argument must be of type array|object, null given if simple_xml fails to get any field values

Created on 30 September 2024, 6 months ago

Problem/Motivation

If a source row being used with the simple_xml parser plugin has nothing in the XML for any of the fields, then $this->currentItem is still NULL when we get here:

      foreach ($this->currentItem as $field_name => $values) {

Steps to reproduce

Proposed resolution

Either cast to array or throw an exception to alert the developer that there is a problem.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

6.0

Component

Plugins

Created by

🇬🇧United Kingdom joachim

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

Comments & Activities

Production build 0.71.5 2024