magento2 icon indicating copy to clipboard operation
magento2 copied to clipboard

Join extension attributes are not added to Order results (REST api)

Open Bbbrinks opened this issue 9 years ago • 7 comments

Preconditions

  1. Magento 2.1.3
  2. PHP 7.0.8-0ubuntu0.16.04.3

Steps to reproduce

  1. Define a Extension attribute for the OrderInterface with a join table:
    <extension_attributes for="Magento\Sales\Api\Data\OrderInterface">
        <attribute code="some_id" type="string">
            <join reference_table="SOMETABLE" join_on_field="quote_id" reference_field="quote_id">
                <field>some_id</field>
            </join>
        </attribute>
    </extension_attributes>
  1. Make sure there's matching data in the SOMETABLE table and the sales_order table
  2. Request orders via REST

Expected result

  1. I expected to see some_id in the resulting json response (this does work for Quote extension attributes).

Actual result

  1. No some_id in the extension attributes property of the json response

Bbbrinks avatar Jan 04 '17 15:01 Bbbrinks

As far as I can see there's a missing call in /magento/module-sales/Model/OrderRepository.php:

$this->extensionAttributesJoinProcessor->process($this->quoteCollection);

The //magento/module-quote/Model/QuoteRepository.php does have this call.

Bbbrinks avatar Jan 04 '17 15:01 Bbbrinks

Is there any update on this?

PaulBoss avatar Aug 24 '17 12:08 PaulBoss

@sterfpaul, thank you for your report. We've created internal ticket(s) MAGETWO-81288 to track progress on the issue.

magento-engcom-team avatar Oct 09 '17 12:10 magento-engcom-team

Hi @sterfpaul. Thank you for your report. The issue has been fixed in magento-engcom/magento2ce#1168 by @nmalevanec in 2.2-develop branch Related commit(s):

The fix will be available with the upcoming 2.2.4 release.

magento-engcom-team avatar Feb 22 '18 09:02 magento-engcom-team

Hi @sterfpaul. Thank you for your report. The issue has been fixed in magento/magento2#16169 by @Scarraban in 2.1-develop branch Related commit(s):

The fix will be available with the upcoming 2.1.16 release.

sidolov avatar Sep 14 '18 11:09 sidolov

This seems to have been removed in 2.3, or was never included in the first place. I can't find any commit removing it, why was it?

Ian410 avatar Feb 28 '19 19:02 Ian410

Hi @Bbbrinks. Thank you for your report. The issue has been fixed in magento/magento2#21797 by @swnsma in 2.3-develop branch Related commit(s):

The fix will be available with the upcoming 2.3.2 release.

magento-engcom-team avatar Apr 23 '19 22:04 magento-engcom-team