1

How to override the core "module-store/Setup/Patch/Data/DisableSid.php" into "app/code/Mymodule/Test/" module. can anyone please help me.

Thanks

1

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 [];
    }
}
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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