Skip to content

Shipment Create via API salesShipmentRepositoryV1 throw Fatal error in Admin Order -> Shipment -> View #22686

@milindsingh

Description

@milindsingh

Shipment Create via API salesShipmentRepositoryV1 throw Fatal error in Admin Order -> Shipment -> View

Preconditions (*)

  1. Magento 2.3.1/2.3.0
  2. The order created via Admin Panel

Steps to reproduce (*)

  1. Create an order created from Admin Panel
  2. Create Shipment via API:
{
  "entity": {
    "increment_id": "000000003",
    "order_id": 3,
    "items": [
        {
          "sku": "WSH12-32-Red",
          "qty": 1
        }
      ],
    "tracks": [
      {
        "order_id": 3,
        "qty": 1,
        "track_number": "123",
        "title": "Test",
        "carrier_code": "dhl"
      }
    ]  
  }
}
  1. Goto Admin -> Sales -> Order -> View -> Shipments -> View

Expected result (*)

  1. Shipment Details should be rendered without any Fatal Error as API shipment creation was successful.

Actual result (*)

  1. Fatal Error in Admin Shipment View
Fatal error: Uncaught Error: Call to a member function getParentItem() on null in /opt/lampp7.2/htdocs/magento/2.3.sample/vendor/magento/module-shipping/view/adminhtml/templates/view/items.phtml:19 Stack trace: #0 /opt/lampp7.2/htdocs/magento/2.3.sample/vendor/magento/framework/View/TemplateEngine/Php.php(59): include() #1 /opt/lampp7.2/htdocs/magento/2.3.sample/vendor/magento/framework/View/Element/Template.php(271): Magento\Framework\View\TemplateEngine\Php->render(Object(Magento\Shipping\Block\Adminhtml\View\Items), '/opt/lampp7.2/h...', Array) #2 /opt/lampp7.2/htdocs/magento/2.3.sample/vendor/magento/framework/View/Element/Template.php(301): Magento\Framework\View\Element\Template->fetchView('/opt/lampp7.2/h...') #3 /opt/lampp7.2/htdocs/magento/2.3.sample/vendor/magento/module-backend/Block/Template.php(129): Magento\Framework\View\Element\Template->_toHtml() #4 /opt/lampp7.2/htdocs/magento/2.3.sample/vendor/magento/framework/View/Element/AbstractBlock.php(668): Magento\Backend\Block\Template->_toHtml() #5 /opt/lampp7 in /opt/lampp7.2/htdocs/magento/2.3.sample/vendor/magento/module-shipping/view/adminhtml/templates/view/items.phtml on line 19

https i 17828 2 3 develop instances magento community engineering admin admin order_shipment view shipment_id 1

screenshot from 2018-12-28 13-19-42

Related Issues:
https://github.com/magento-engcom/msi/issues/2220
#17828

Note:
I think the Shipment creation via API have missed some required data, which is not validated at time of processing the call, causing fatal errors.

Metadata

Metadata

Assignees

Labels

Event: dmcdindia1Fixed in 2.2.xThe issue has been fixed in 2.2 release lineFixed in 2.3.xThe issue has been fixed in 2.3 release lineIssue: Format is validGate 1 Passed. Automatic verification of issue format passed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions