- 🇪🇸Spain bmunslow
I was hit by this as well, getting wrong total counts for some XML migrations whereby rows are filtered by a Xpath attribute. Patch is simple, straightforward and fixes the issue.
Since it's such a simple fix, setting this to RTBC.
I ran into an issue with a migration with XML data parser plugin when using an XPath attribute in its item_selector
like item_selector: /Items/Item[@type="foo"]
.
The exception is : "Migration failed with source plugin exception: Index is defined as a source ID but has no value".
Looking at the code in Xml::fetchNextRow()
, when an element matching the selector is found, $target_element
gets it as SimpleXml and then tests the Xpath predicate. If the predicate is not empty but does not match the element, variable $target_element
should be unset, otherwise if no "better" element is found in the XML document, the one in $target_element
would still be used.
This case may happen when looking for a /Items/Item[@type="foo"]
when we only have <items><item type="bar"></item></items>
.
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
I was hit by this as well, getting wrong total counts for some XML migrations whereby rows are filtered by a Xpath attribute. Patch is simple, straightforward and fixes the issue.
Since it's such a simple fix, setting this to RTBC.