1

After ugprade to M2 2.2.4, I got problem in my custom module. The module has console command but upon upgrade I'm getting "Area code is not set". After few hours of debugging, I found out that the root cause is calling \Magento\Sales\Model\Order object as parameter in my __Construct function.

Replacing it with reourceModel will work, but I'm just wondering why the main order model is not working. Any idea?

1

Change:

\Magento\Sales\Model\Order

To:

\Magento\Sales\Model\OrderFactory

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.