Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Area code is already set #166

Closed
aibean opened this issue Feb 17, 2022 · 2 comments
Closed

Area code is already set #166

aibean opened this issue Feb 17, 2022 · 2 comments

Comments

@aibean
Copy link

aibean commented Feb 17, 2022

klaviyo/magento2-extension 4.0.1

When running the following command:

bin/magento queue:consumer:start product_action_attribute.update

I get,

In State.php line 136:
Area code is already set  

If I trace the error I get the following output:

#0  Magento\Framework\App\State->setAreaCode(adminhtml) called at [/var/www/html/vendor/klaviyo/magento2-extension/Helper/ScopeSetting.php:72]
#0  Magento\Framework\App\State->setAreaCode(global) called at [/var/www/html/vendor/magento/module-message-queue/Console/StartConsumerCommand.php:91]
@mamsincl
Copy link

mamsincl commented Jul 14, 2023

+1 with 4.0.11


edit:
the culprit found in custom code injecting Klaviyo\Reclaim\Helper\Logger into __construct where the area code set in construct workflow - my specific resolution is to use Klaviyo\Reclaim\Helper\Logger\Proxy to overcome the issue


This is still Magento coding standard issue as area code have never been set in the constructor workflow

@cykolln cykolln mentioned this issue Sep 17, 2024
4 tasks
@cykolln
Copy link
Contributor

cykolln commented Sep 25, 2024

We believe this has been fixed in the latest release!

@cykolln cykolln closed this as completed Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants