Join extension attributes are not added to Order results (REST api)
Preconditions
- Magento 2.1.3
- PHP 7.0.8-0ubuntu0.16.04.3
Steps to reproduce
- 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>
- Make sure there's matching data in the SOMETABLE table and the sales_order table
- Request orders via REST
Expected result
- I expected to see some_id in the resulting json response (this does work for Quote extension attributes).
Actual result
- No some_id in the extension attributes property of the json response
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.
Is there any update on this?
@sterfpaul, thank you for your report. We've created internal ticket(s) MAGETWO-81288 to track progress on the issue.
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.
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.
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?
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):
- 961e05c23d074b00ebf7c411d6bb677d467244be
- 4603abc5e36637758ffc48ec93c7a08cd51b45b7
- a45fb74cac0e9efa8a5ce9c304a8b55f1ce6e393
The fix will be available with the upcoming 2.3.2 release.