Skip to main content

Questions tagged [patch-data]

Filter by
Sorted by
Tagged with
0 votes
2 answers
198 views

How to create data patch to insert data in dynamic blocks in Magento 2.4?

How to create data patch to insert data into the database for dynamic blocks?
Vinod Kumar's user avatar
  • 2,065
0 votes
0 answers
58 views

New custom product type - order cancel getting error in magento 2.4.5 and greater version

A new product type created using following link https://aureatelabs.com/blog/how-to-create-a-new-product-type-in-magento-2/ New product type is successfully created and Order placed for new product ...
Chippy Ani's user avatar
0 votes
1 answer
1k views

Adding a product select attribute with a source in Magento 2.4

I've created a module to add a product attribute with a select input using a source for the options. I've used a data patch to add the attribute. I can see the patch in the patch_list table but it's ...
user3417608's user avatar
1 vote
2 answers
1k views

($callback) must be a valid callback

My extension is failing varnish test over and over again and the only visible error i have found in the error reports is call_user_func(): Argument #1 ($callback) must be a valid callback, class "...
Syed Hassan Zamir's user avatar
0 votes
1 answer
396 views

public static function getVersion() : m2

Setup Data Patch script is executed successfully after running setup:upgrade command. Now i want to execute same script with public static function getVersion() function. Module version is : <?xml ...
Jimit Bhavsar's user avatar
0 votes
3 answers
483 views

Magento 2.4 get template file in data patch

I'm trying to insert a template file as the content for the block I'm adding programmatically, but I'm not sure how this can be done. I've added the template file in view/frontend/templates/template-...
Frank Groot's user avatar
1 vote
3 answers
3k views

Magento 2.4 Unable to apply data patch: Area code is not set

While executing below data patch with setup:upgrade the following error appears in the console. Unable to apply data patch Vendor\Module\Setup\Patch\Data\ModuleName for module Vendor_Module. Original ...
Frank Groot's user avatar
0 votes
1 answer
460 views

How to add table schema as a dependency in setup patch data?

I am creating a custom Module, in that I created a custom table and patch data. The patch data for inserting data into that table. Now the issue is, the custom table was created through declarative ...
Siranjeevi K S's user avatar
0 votes
1 answer
618 views

How to add new field to 'catalog_product_option' table using Schema Patch?

I have created a custom option checkbox field, now on save, i have to update the value(0/1) to the table 'catalog_product_option' so that i can utilize this field on frontend. How can i achieve this ...
Wakar Ahamad's user avatar
0 votes
0 answers
441 views

Magento2: Config data save using Custom Module

I want to save encrypted value in core_config_data while setup upgrade without using config.xml. I am trying to use data patch file Vendor\Credentials\Setup\Patch\Data\AddData.php use Magento\...
Paras Arora's user avatar
-1 votes
1 answer
766 views

Added custom customer attribute with patch script but it gives an error

I added a custom attribute to my customer with a data patch script. The attribute is added in the database tables but when I try to register a new customer I get this error: main.CRITICAL: Exception ...
amjada's user avatar
  • 11
2 votes
1 answer
2k views

Magento 2: How to update the store configuration value using Data Patch

i want to update the store configuration value using Data Patch. Note: please do not suggest install and upgrade script. i tried below code but its not working: <?php /** * Copyright © All ...
adi maheshwary's user avatar
0 votes
1 answer
389 views

Remove trailing and first space from sku

I have Magento 2.2.2. Some SKU products contain a trailing space. How to using data patch or MySQL database query which will remove all leading and trailing spaces from SKU products.
Alice's user avatar
  • 148
0 votes
0 answers
207 views

Missing Product scope after create websites/stores/storeviews via Data/Patch - Magento V2.4 Enterprise

I faced an issue. After create script Data/Patch to create multi websites/stores/storeviews. At dropdown of Scope Product, i dont see new websites/stores/storeviews, in spite of it has in ...
Nguyễn Hoàng Tuấn's user avatar
2 votes
3 answers
3k views

Problem in creating Drop down product attribute in Magento2

I have created a Data patch file to create the product drop down attribute with options. used the following code in it. <?php declare(strict_types=1); namespace Custom\Module\Setup\Patch\Data; ...
Jafar Pinjar's user avatar
  • 1,951
0 votes
1 answer
2k views

Patch Not Working

Patch File: Bedard/CustomGloves/Setup/Patch/Data <?php namespace Bedard\CustomGloves\Setup\Patch\Data; use Magento\Framework\Setup\Patch\DataPatchInterface; use Magento\Framework\Setup\Patch\...
user857276's user avatar
2 votes
3 answers
8k views

Create attribute option using Data patch in Magento2

I am creating a product attribute with option using Magento 2.3 Data patch. Used below code. <?php declare(strict_types=1); namespace Vendor\Module\Setup\Patch\Data; use Magento\Eav\Model\...
Jafar Pinjar's user avatar
  • 1,951
0 votes
1 answer
960 views

How to change assigned group of a custom product attribute?

I have a custom product attribute which is under Advanced Pricing group . I am trying to change attribute group of this attribute via data patch using below code : <?php namespace Vendor\Module\...
amitshree's user avatar
  • 7,076
0 votes
1 answer
2k views

How to update existing CMS block content using data patches?

I have updated content for the existing cms page by using data patches in Magento 2.3.3, but the same approach not working for CMS block. <?php namespace Test\CmsExport\Setup\Patch\Data; use ...
Muthukumar Sivasamy's user avatar
1 vote
1 answer
320 views

Magento 2: Adding quote and order attribute using patch data

Can we add custom quote and order attribute/field using patch data in Magento 2.3.x ? If yes then how it can be done ?
Kishan Patadia's user avatar