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.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | fix_xml_output.patch | 1.1 KB | sepgil |
| #2 | restws-commerce_xml_error-1451952-2.patch | 741 bytes | techninja |
Comments
Comment #1
mlncn commentedComment #2
techninja commentedHad 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.
Comment #3
klausiSebastian will look at this during GSoC.
Comment #4
sepgil commentedThe 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.
Comment #5
sepgil commentedComment #6
klausiImproved the comment a bit and committed it to 7.x-2.x.
Comment #7.0
(not verified) commentedAdded to the initial post regarding the inaccurate nature of the title.