0

I found out that calling sales_order.info via SOAP in CE 1.9.3.0 does not return Order Items. Instead I only get something array-like:

<items SOAP-ENC:arrayType="ns1:salesOrderItemEntity[1]" xsi:type="ns1:salesOrderItemEntityArray"> <item xsi:type="ns1:salesOrderItemEntity"/> </items>

In CE 1.9.2.3 you definitely get all order items back. Is this a bug or how can you retrieve the order items?

0

I found the solution: There is a new function which induces a array to string conversion error. It is: Mage_Api_Model_Server_Handler_Abstract::processingRow()

There you can see:

/**
 * Prepare Api row data for XML exporting
 * Convert not allowed symbol to numeric character reference
 *
 * @param $row
 * @return mixed
 */
public function processingRow($row)
{
    $row = preg_replace_callback(
        '/[^\x{0009}\x{000a}\x{000d}\x{0020}-\x{D7FF}\x{E000}-\x{FFFD}\x{10000}-\x{10FFFF}]/u',
        function ($matches) {
            return '&#' . Mage::helper('core/string')->uniOrd($matches[0]) . ';';
        },
        $row
    );
    return $row;
}

But in order to handle that correctly it should be:

/**
 * Prepare Api row data for XML exporting
 * Convert not allowed symbol to numeric character reference
 *
 * @param $row
 * @return mixed
 */
public function processingRow($row)
{
    if (is_array($row)) {
        foreach ($row as $key => $entry) {
            $row[$key] = $this->processingRow($entry);
        }
    } else {
        $row = preg_replace_callback(
            '/[^\x{0009}\x{000a}\x{000d}\x{0020}-\x{D7FF}\x{E000}-\x{FFFD}\x{10000}-\x{10FFFF}]/u',
            function ($matches) {
                return '&#' . Mage::helper('core/string')->uniOrd($matches[0]) . ';';
            },
            $row
        );
    }

    return $row;
}

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.