Magento 2.2.4 & 2.2.5 Bug - Cannot update theme bug fix: Not able to override the abstract class AbstractTemplate

magento.stackexchange https://magento.stackexchange.com/questions/231851

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.

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
scroll top