Open
Description
Preconditions and environment
- Magento version 2.4
Steps to reproduce
- Retrieve auth token from the admin endpoint /V1/integration/admin/
- Request endpoint: POST : //yourstore/rest/V1/order/{orderId}/ship
Payload:
{
"items": "[]"
}
Other below APi's also got effected and getting similar error in logs:
- POST request to /V1/inventory/stock-source-links with payload:
{"links": "[]"} - POST request to /rest/V1/inventory/source-items with payload:
{"sourceItems": "\[]\"} - POST request to //V1/inventory/low-quantity-notification with payload:
{"sourceItemConfigurations": ""} - POST request to /rest/V1/inventory/stock-source-links-delete with payload:
{"links": "\[]\"}
Expected result
Returns a 400 error as the request is malformed.
Actual result
Returns a 500 status code from a null TypeError .
Additional information
output of var/log/system.log:
[2022-08-01T12:54:49.463557+00:00] main.CRITICAL: TypeError: Magento\Sales\Model\ShipOrder::execute(): Argument #2 ($items) must be of type array, null given in /magento/vendor/magento/module-sales/Model/ShipOrder.php:133
Stack trace:
#0 [internal function]: Magento\Sales\Model\ShipOrder->execute()
#1 /magento/vendor/magento/module-webapi/Controller/Rest/SynchronousRequestProcessor.php(95): call_user_func_array()
#2 /magento/vendor/magento/module-webapi/Controller/Rest.php(188): Magento\Webapi\Controller\Rest\SynchronousRequestProcessor->process()
#3 /magento/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Webapi\Controller\Rest->dispatch()
#4 /magento/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Webapi\Controller\Rest\Interceptor->___callParent()
#5 /magento/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Webapi\Controller\Rest\Interceptor->Magento\Framework\Interception\{closure}()
#6 /magento/generated/code/Magento/Webapi/Controller/Rest/Interceptor.php(23): Magento\Webapi\Controller\Rest\Interceptor->___callPlugins()
#7 /magento/vendor/magento/framework/App/Http.php(116): Magento\Webapi\Controller\Rest\Interceptor->dispatch()
#8 /magento/generated/code/Magento/Framework/App/Http/Interceptor.php(23): Magento\Framework\App\Http->launch()
#9 /magento/vendor/magento/framework/App/Bootstrap.php(264): Magento\Framework\App\Http\Interceptor->launch()
#10 /magento/pub/index.php(30): Magento\Framework\App\Bootstrap->run()
#11 {main} [] []
Release note
No response
Triage and priority
- Severity: S0 - Affects critical data or functionality and leaves users without workaround.
- Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
- Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
- Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
- Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
Metadata
Metadata
Assignees
Labels
Use with concrete module component label E.g. "Component: Api" + "Catalog"Gate 3 Passed. Manual verification of the issue completed. Issue is confirmedA defect with this priority could have functionality issues which are not to expectations.Indicates original Magento version for the Issue report.The issue has been reproduced on latest 2.4-develop branch