2

On applying any new theme getting an error in the admin panel.something went wrong while saving this configuration. Area is already set

1

Change in this file.

Magento\Email\Model\AbstractTemplate.php

public function setForcedArea($templateId)
{
    if ($this->area) {
        throw new \LogicException(__('Area is already set'));
    }
    $this->area = $this->emailConfig->getTemplateArea($templateId);
    return $this;
}

To:

public function setForcedArea($templateId)
{
    if (!isset($this->area)) {
        $this->area = $this->emailConfig->getTemplateArea($templateId);
    }
    return $this;
}

It will fix the issue.

1

This is known issue in Magento 2.2.4.

You can check below link to resolve your issue.

https://github.com/magento/magento2/issues/14968

Go through it and change code as workaround.

If you are connected to git than you can pull from git to make your Magento installtion updated.

1

Here is the solution:

Edit inside this file path:

vendor/magento/module-email/Model/AbstractTemplate.php

Replace this code:

public function setForcedArea($templateId)
{
if ($this->area) {
throw new \LogicException(__('Area is already set'));
}
$this->area = $this->emailConfig->getTemplateArea($templateId);
return $this;

Replace With:

    public function setForcedArea($templateId)
{
if (!isset($this->area)) {
$this->area = $this->emailConfig->getTemplateArea($templateId);
}
return $this;
}
0

This is known issue of Magento 2.2.4 I have solved this issue by updating the following file:

Magento\Email\Model\AbstractTemplate

public function setForcedArea($templateId)
{
    if (!isset($this->area)) {
        $this->area = $this->emailConfig->getTemplateArea($templateId);
    }
    return $this;
}

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.