6

I have upgraded to version 2.2.4 from 2.2.3 now I'm getting error when try to save theme seting

enter image description here

  • I'm getting the same; no idea what that means. – Kristoffer Vågen Birkenes May 6 '18 at 8:13
  • Me too, it must be a bug, also I noticed that my product meta titles are gone in simple products and breadcrumbs are gone too also the back button text has changed. – Coen Ponsen May 10 '18 at 11:11
17

This is a re-owned issue of Magento 2.2.4 C.E.

Magento has been fixed by Daniel Ruf at https://github.com/magento/magento2/commit/7019a0a1392095185505ff3ca7b97dd3e9cb4ef2 at PR #15137 and already merge at 2.2-develop branch

You need to modify the code of Magento\Email\Model\AbstractTemplate setForcedArea method and Replace that method code using below one.

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

And it will be released on coming any version.Still is not fixed 2.2.5

  • It is not released in 2.2.5. I am getting same error in CE 2.2.5. Can you please help me to override this file ? – MGento Jun 29 '18 at 6:41
  • The above fix is not working for me in version 2.2.5. is there any other solution to solve this? – Divya Muralidharan Jul 4 '18 at 7:02
4

It's thrown by this function in file vendor/magento/module-email/Model/AbstractTemplate.php on line 570.

Note I have commented out the error throwing part - which allows me to change the theme with what seems to be no ill effects. You could probably get the same results.

/**
 * Store the area associated with a template so that it will be returned by getDesignConfig and getDesignParams
 *
 * @param string $templateId
 * @return $this
 * @throws \Magento\Framework\Exception\MailException
 */
public function setForcedArea($templateId)
{
    #if ($this->area) {
    #    throw new \LogicException(__('Area is already set'));
    #}
    $this->area = $this->emailConfig->getTemplateArea($templateId);
    return $this;
}

  • Can you help me overriding vendor/magento/module-email/Model/AbstractTemplate.php? – Mohit Kumar Arora May 28 '18 at 9:44
  • Your solution is working great if I make changes in the vendor file, but since the class is an abstract class, I am not able to override it. – Mohit Kumar Arora May 28 '18 at 9:45
  • @MohitKumarArora How did you override it ? I have tried to override it using the plugin way, but not working for me. Any help would be greatly appreciated. – MGento Jun 29 '18 at 6:38
  • 1
    @MGento, please try this github.com/pfortin-expertime/MageFix-Misc – Mohit Kumar Arora Jun 29 '18 at 6:52
  • @MGento, Can you post a question for this and upvote my answer there? – Mohit Kumar Arora Jun 29 '18 at 10:35
1

I have overridden this function using a plugin. Please find my answer here https://magento.stackexchange.com/a/232745/48571

Not the answer you're looking for? Browse other questions tagged or ask your own question.