Magento 2.2.4:  Theme Switching Error Message Solution

Magento 2.2.4: Theme Switching Error Message Solution

Did you try to install/upgrade Magento 2.2.4 version? We sure that you also met the “Something went wrong while saving this configuration: Area is already set” error message in you back-end while trying to change the default theme. The problem came from the core of Magento.

Magento 224 Issue

Luckily, the solution to fix this is quite easy. But please note that this is Magento 2.2.4 know issue and below fix is just a temporary fix, you should not directly change Magento core file (override or create a plugin).

You can apply “How To Fix Theme Switching Error Message In 2.2.4” to fix it now and remove it after Magento developers fix the core issue.

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;
}

Thanks for reading!

phuongptt

Nothing is impossible!

Related News