Andrew Smith
Andrew Smith

Reputation: 397

theme can not be changed in magento 2.2.4

We have installed a fresh copy of magento 2.2.4 however it is not allowing us to change the theme and throwing the exception "Something went wrong while saving this configuration: Area is already set"

Upvotes: 1

Views: 228

Answers (1)

Andrew Smith
Andrew Smith

Reputation: 397

Please make changes given below 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;
}

Replace above code with :-

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

Using this code problem will be fixed however it is not a good practice to make changes in vendor files of magento. You can also update to latest version of magento i.e. magento 2.2.5 onwards to fix this problem

Upvotes: 1

Related Questions