- Issue created by @gresko8
We have an XML "importer" set-up on one of our sites that is based on migrate module. When the XML is empty, which is still a valid case in our scenario (nothing new will be imported), we are getting type error from the counting function:
TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in MigrateItemsXML->computeCount() (line 694 of migrate/plugins/sources/xml.inc).
Run a migration with an empty XML.
Since we are using NULL as a value for cacheIDs property when there are no items, let's ask if we have the value first and only then call the count() or return 0 directly if we do not have a countable value.
Active
2.0
Code