Magento 2.2.4 – Fix ‘Area is Already Set’ Error While Saving Configuration

magento2.2.4theme

I am unable to apply a new theme in a clean install of 2.2.4. Upading to 2.2.5 does not fix the problem.

Best Answer

Note : This is a know issue in Magento 2.2.4 (see GitHub issue) and below fix is just a temp fix. You should not directly change the Magento core file (override or create a plugin)

Change in Magento\Email\Model\AbstractTemplate.php this:

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

For this:

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

It should fix the issue

Update : can also be fixed by applying this Patch

Related Topic