Closed
Description
The bug is in the call to:
$source->children()
If an XML node has no child nodes and no attributes, this resolves to FALSE
However, if the XML node has no children and has one or more attributes it resolves to TRUE when clearly it should not.
See the line of code in question:
https://github.com/magento/magento2/blob/develop/lib/internal/Magento/Framework/Simplexml/Element.php#L329
This line needs to be changed to
if(count($source->children())) {
Please see this Gist
https://gist.github.com/tim-reynolds/ac20289acdcfcde3633f
The bug exists in Magento 1.X as well as 2.0.
I would really blame PHP SimpleXMLElement but we can't readily fix that.
Activity