Skip to content

Commit

Permalink
Do not initialize context when the store is already initialized in CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
PululuK authored Feb 12, 2024
1 parent 7af2b6f commit cbc2f25
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions classes/controller/AdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2881,6 +2881,11 @@ public function initShopContext()
return;
}

// Do not initialize context when the store is already initialized in CLI
if (Tools::isPHPCLI() && $this->context) {

Check failure on line 2885 in classes/controller/AdminController.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (8.1)

Right side of && is always true.

Check failure on line 2885 in classes/controller/AdminController.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (8.2)

Right side of && is always true.
return;
}

// Change shop context ?
if (Shop::isFeatureActive() && Tools::getValue('setShopContext') !== false) {
$this->context->cookie->shopContext = Tools::getValue('setShopContext');
Expand Down

0 comments on commit cbc2f25

Please sign in to comment.