I want to override method setForcedArea()
because I'm using Magento 2.2.4 & whenever I tried to save Content->Configration->Design Configuration->Edit
I'm getting following error:-
Something went wrong while saving this configuration: Area is already set
Screenshot:-
When i R&D then found that it's M2.2.4 issue so I've to modify this method.
Here is the Module :-
Step1:- app/code/Allin/Coreissueresolve/etc/registration.php =>
<?php
\Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::MODULE,
'Allin_Coreissueresolve',
__DIR__
);
Step2:- app/code/Allin/Coreissueresolve/etc/module.xml =>
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd">
<module name="Allin_Coreissueresolve" setup_version="1.0.0"></module>
<sequence>
<module name="Magento_Backend"/>
<module name="Magento_Sales"/>
<module name="Magento_Quote"/>
<module name="Magento_Checkout"/>
</sequence>
</config>
Step3:- app/code/Allin/Coreissueresolve/etc/di.xml =>
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="Magento\Email\Model\AbstractTemplate" type="Allin\Coreissueresolve\Model\Magento\Email\AbstractTemplate" />
</config>
Step4:- app/code/Allin/Coreissueresolve/Model/MagentoEmail/AbstractTemplate.php =>
<?php
namespace Allin\Coreissueresolve\Model\Magento\Email;
abstract class AbstractTemplate extends \Magento\Email\Model\AbstractTemplate
{
public function setForcedArea($templateId)
{
echo "Hello123" ; exit;
}
}
After that i've run php/bin/magento setup:upgrade
& also cache:flush
.
But app/code/Allin/Coreissueresolve/Model/MagentoEmail/AbstractTemplate.php
=> setForcedArea()
is not calling.
While vendor\magento\module-email\Model\AbstractTemplate.php
=> setForcedArea()
is calling everytime.
AbstractTemplate.php
file I get open for write: permission denied File transfer failed Can you please help?