I am having trouble to update the theme in Magento 2.2.5 due to the known issue in setForcedAre function of the file Magento\Email\Model\AbstractTemplate.php

As per the fixes by Daniel Ruf, updating the setForcedArea function will fix the error, but I am having trouble to override the core file Magento\Email\Model\AbstractTemplate.php.

Let me know how to override this core file. I have tried overriding this file using the preference way and also by the plugin way, but it's not working.

1 Answer 1


This is a known bug in Magento 2.x and still not fixed till Magento 2.2.5.

Since the class is an abstract class, we can not override it directly.

Here is a workaround for fixing the issue. Please check the following link.

I could have written a long answer for this by writing the same code here but why should we write the same code again and again when someone has already fixed it.

Please let me know if it fixed your issue.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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