Skip to content

Error While Trying To Load Quote Item Collection Using Magento\Quote\Model\ResourceModel\QuoteItem\Collection::getItems() #8954

@rendyep

Description

@rendyep

Preconditions

  1. Magento 2.1.5

Steps to reproduce

  1. Load Quote Item Collection using Magento\Quote\Model\ResourceModel\QuoteItem\Collection::getItems()

$quoteItemCollection = $this->quoteItemCollectionFactory->create()->getItems();

Expected result

  1. I get array of Quote Items

Actual result

  1. Thrown an error:
    Fatal error: Uncaught Error: Call to a member function getStoreId() on null in C:\www\magento2\vendor\magento\module-quote\Model\ResourceModel\Quote\Item\Collection.php:98
    Stack trace:
    #0 C:\www\magento2\vendor\magento\module-quote\Model\ResourceModel\Quote\Item\Collection.php(209): Magento\Quote\Model\ResourceModel\Quote\Item\Collection->getStoreId()
    #1 C:\www\magento2\vendor\magento\module-quote\Model\ResourceModel\Quote\Item\Collection.php(169): Magento\Quote\Model\ResourceModel\Quote\Item\Collection->_assignProducts()
    #2 C:\www\magento2\vendor\magento\framework\Data\Collection\AbstractDb.php(586): Magento\Quote\Model\ResourceModel\Quote\Item\Collection->_afterLoad()
    #3 C:\www\magento2\vendor\magento\framework\Data\Collection\AbstractDb.php(557): Magento\Framework\Data\Collection\AbstractDb->loadWithFilter(false, false)
    #4 C:\www\magento2\vendor\magento\framework\Data\Collection.php(333): Magento\Framework\Data\Collection\AbstractDb->load()
    #5 ----------

Metadata

Metadata

Assignees

Labels

Component: CheckoutFixed in 2.1.xThe issue has been fixed in 2.1 release lineFixed 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: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentReproduced on 2.1.xThe issue has been reproduced on latest 2.1 releaseReproduced on 2.2.xThe issue has been reproduced on latest 2.2 releaseReproduced on 2.3.xThe issue has been reproduced on latest 2.3 releasebug report

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions