On applying any new theme getting an error in the admin panel.something went wrong while saving this configuration. Area is already set
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.
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.
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;
}
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;
}