cancel
Showing results for 
Search instead for 
Did you mean: 

Bug: XML-RPC API cannot return arrays

SOLVED

Bug: XML-RPC API cannot return arrays

I found a bug in magento 1.9.3.0. I am not sure how to report it properly, since the "Report issue" I found was down for maintenance.

I will post it on these forums in hope that it will reach the right person.

 

Problem

I make an API request using XML-RPC to sales_order_shipment.info. (http://pastebin.com/4ZR9CCkA)

In the response, I expect to get back arrays for the items and tracks fields.

Instead, I get back the string "Array".

Complete response: http://pastebin.com/y75R3uT7

 

Code problem

I traced the issue to the Mage_Api_Model_Server_Handler_Abstract class and the processingRow function.

It does not handle arrays of arrays, so in this case inner arrays always get converted to the string "Array".

 

Solution

I made processingRow handle arrays by making it recursive. I submitted a PR to the magento-mirror github repo with a proposed fix for those who are interested: https://github.com/OpenMage/magento-mirror/pull/36

 

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Bug: XML-RPC API cannot return arrays

1 REPLY 1

Re: Bug: XML-RPC API cannot return arrays