Problem/Motivation
Currently the SubProcess
migrate process plugin has some issues, when dealing with XMLs as source data (in combination with migrate_plus
).
Example XML structure:
<?xml version="1.0" encoding="UTF-8" ?>
<article>
<elements>
<id>element.text.001</id>
</elements>
<elements>
<id>element.text.002</id>
</elements>
</article>
The corresponding migration fetches all elements
nodes via the following XPath statement: /article/elements
.
As a result, I get an array of SimpleXMLElement
objects - one for each elements
XML node.
I am currently trying to pass this array of SimpleXMLElement
objects to the SubProcess
plugin. In its transform
method, there is the following line of code that creates the new data sub-row (where $new_value
is the currently subprocessed SimpleXMLElement
of the passed in array):
$new_row = new Row($new_value + $source);
This code unfortunately errors out, due to the fact that you can't merge a SimpleXMLElement
object with an array like this.
Proposed resolution
- Ensure that the
$new_value
variable is an array before trying to merge it with$source
Remaining tasks
- Create a patch
User interface changes
n/a
API changes
n/a
Data model changes
n/a