Open francescosalvi opened 3 years ago
Hi @francescosalvi. Thank you for your report. To help us process this issue please make sure that you provided sufficient information.
Please, add a comment to assign the issue: @magento I am working on this
I confirm I faced similar issue when using
Magento\Sales\Api\ShipOrderInterface
The plugin takes the sourceCode
from the request instance. It would be nice to check is sourceCode already assigned as ExtensionAttribute and if not then resolve it form request or other places.
\Magento\InventoryShipping\Plugin\Sales\Shipment\AssignSourceCodeToShipmentPlugin::afterCreate
Preconditions (*)
Magento 2.4.2 (tested with a vanilla-ish installation, i.e. disabling all non-core modules)
composer info | grep module-inventory
Steps to reproduce (*)
Expected result (*)
Actual result (*)
Root cause, additional information
\Magento\InventoryShipping
handles saving of thesourceCode
Shipment's extension attribute in \Magento\InventoryShipping\Plugin\Sales\ResourceModel\Order\Shipment\SaveSourceForShipmentPlugin::afterSave, and defaults todefault
in case it was not previously hydrated. The issue is that the only hydration points I found so far for such extension attribute, do not cover the Shipment being loaded via collection such as in the repro snippet above, which emulates the real word scenario of async shipment email sending (which is what let me discover the bug in the first place):