How to override the core "module-store/Setup/Patch/Data/DisableSid.php" into "app/code/Mymodule/Test/" module. can anyone please help me.
Thanks
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityHow to override the core "module-store/Setup/Patch/Data/DisableSid.php" into "app/code/Mymodule/Test/" module. can anyone please help me.
Thanks
You cannot rewrite this Patch data this way.
Patch data are run one time. So override is NOT the solution for this.
I guess that you want to make web/session/use_frontend_sid
field value to 1
So, create A data patch on your custom module: and change this field value to 1.
<?php
namespace {VendorName}\{ModuleName}\Setup\Patch\Data;
use Magento\Framework\Setup\ModuleDataSetupInterface;
use Magento\Framework\Setup\Patch\DataPatchInterface;
use Magento\Framework\App\Config\MutableScopeConfigInterface;
class {ClassName} implements DataPatchInterface
{
const SCOPE_STORE = 'store';
/**
* @var \Magento\Framework\App\Config\MutableScopeConfigInterface
*/
private $mutableScopeConfig;
/**
* @var ModuleDataSetupInterface
*/
private $moduleDataSetup;
public function __construct(
ModuleDataSetupInterface $moduleDataSetup,
MutableScopeConfigInterface $mutableScopeConfig
) {
$this->moduleDataSetup = $moduleDataSetup;
$this->mutableScopeConfig = $mutableScopeConfig;
}
public function apply()
{
$this->moduleDataSetup->startSetup();
$this->mutableScopeConfig->setValue(self::XML_PATH_USE_FRONTEND_SID, 1, self::SCOPE_STORE);
$this->moduleDataSetup->endSetup();
}
public function getAliases()
{
return [];
}
public static function getDependencies()
{
return [];
}
}