cancel
Showing results for 
Search instead for 
Did you mean: 

Exception Area code is not set

Exception Area code is not set

Hi, I am writing a CLi import tool for a client. The initial import was fine, however now, when I try to update existing products, or add new ones, I get the Area code is not set exception.

 

I have injected Magento\Framework\App\State in to my  constructor, and I'm setting the area code in the execute function with $this->state->setAreaCode('adminhtml'); I can get the products from the collection however when I save the problem. the exception occurs. 

I try to set the state again, but as expected, I get the Area code already set exception.

 

any suggestions would be appreciated.

 

Regards,

 

Steve

 

 

1 REPLY

Re: Exception Area code is not set

Hey,

 

Can you please post whole file code?