Questions tagged [patch-data]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
3 answers
2k 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 ...
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\...
0 votes
0 answers
43 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 ...
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\...
0 votes
0 answers
13 views

Company A is an e-commerce store selling rugs online

Company A is an e-commerce store selling rugs online. Company A wants to charge based on the size of rugs provided by the customer. In backend, show product-wise option to enable/disable this ...
0 votes
0 answers
6 views

Create a custom component to create display design options in admin and design option dropdown and selected will be displayed on product page

Create a custom component to add/edit/delete and view the detail of design information into admin. Associate the multiple design option to product and show selected design option product detail page. ...
0 votes
3 answers
339 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-...
1 vote
2 answers
858 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 "...
0 votes
1 answer
670 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 ...
1 vote
1 answer
225 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 ?
0 votes
1 answer
276 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 ...
0 votes
1 answer
396 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 ...
1 vote
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 ...
0 votes
1 answer
480 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 ...
0 votes
0 answers
431 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\...
-1 votes
1 answer
571 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 ...
0 votes
1 answer
354 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.
0 votes
0 answers
199 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 ...
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; ...
0 votes
1 answer
781 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\...
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 ...