When trying to use RWS with the commerce order entity type, I receive the following error when asking for xml format.

Warning: DOMDocument::createTextNode() expects parameter 1 to be string, array given in RestWSFormatXML::addToXML()
Recoverable fatal error: Argument 1 passed to DOMNode::appendChild() must be an instance of DOMNode, null given,...

I can use JSON and it works fine.

Edit*

The title for this bug report is misleading and for that I apologize. I have tried to change it to Order Entity Type, but have not been successful.

Comments

mlncn’s picture

Title: XML Out No Working for All Entity Types » XML Output Not Working for the Commerce suite's Order Entity Type
techninja’s picture

Status: Active » Needs work
StatusFileSize
new741 bytes

Had the same problem, with the exception being that it was the product entity, not the order entity. Here's a hacky patch that if anything simply avoids the error (IE, does nothing to actually fix the issue). My entity seems to have other problems and returns the string "Array" for the price data key.

klausi’s picture

Issue tags: +GSoC 2012

Sebastian will look at this during GSoC.

sepgil’s picture

StatusFileSize
new1.1 KB

The problem is that the property data of the field commerce_price is a structure, but since it has no property info it is recognized as an EntityValueWrapper. Calling the function EntityValueWrapper::value() won't therefore work.
My patch simply prevents to output complex data types of EntityValueWrappers properties and I think thats the only clean solution.

sepgil’s picture

Status: Needs work » Needs review
klausi’s picture

Status: Needs review » Fixed

Improved the comment a bit and committed it to 7.x-2.x.

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

Added to the initial post regarding the inaccurate nature of the title.