Questions tagged [installdata]

The tag has no usage guidance.

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

In Adminpanel di.xml for graphql [closed]

Autosmart\CategoryAttributes\Model\Resolver\CategoryAttribute resolve
Noor Mohamed's user avatar
1 vote
1 answer
229 views

Unable to add attribute to product by InstallData

I would like to add a custom attribute to the product and create an installData.php according to the guide. However, nothing changed after se:up. Please help. app/code/My/Module/Setup/InstallData.php &...
hill2011's user avatar
1 vote
2 answers
662 views

How to force my db_schema.xml to run after a third-party InstallData.php?

I'm working with a legacy module where they used the old InstallData.php script to build their tables, and now I need to make some changes to them. If I wrote those changes in a db_schema.xml, it gets ...
Ivan Augusto's user avatar
0 votes
2 answers
282 views

data install/upgrade not creating category attribute

i'm trying to add an attribute to the categories, but my setup doesn't add anything the input is visible in the categories, but you even on save the input value stays empty and i can't find any ...
user80390's user avatar
2 votes
0 answers
475 views

Add reply field to Review Form - Magento 2 (current version 2.3.5p1)

I have created the following: registration.php <?php \Magento\Framework\Component\ComponentRegistrar::register( \Magento\Framework\Component\ComponentRegistrar::MODULE, 'Vendor_NewField', ...
Jack Brooks's user avatar
2 votes
1 answer
296 views

Install Data is not executed in magento 2

I am trying to create a category attribute: This is my file form Vendor/Module/Setup: use Magento\Catalog\Model\Category; use Magento\Catalog\Setup\CategorySetupFactory; use Magento\Framework\Setup\...
Attila Naghi's user avatar
  • 3,963
1 vote
1 answer
51 views

Magento2 Install data Custom attr set, attr group, attr

Here is my installation method. Why, after installation, in the default attribute set, I see only the attributes https://prnt.sc/s20b3a, https://prnt.sc/s20czw? They should not be here. How to fix? ...
Goryyn's user avatar
  • 113
1 vote
2 answers
2k views

How to create multiple customer attributes in magento 2?

How to create multiple customer attributes in Magento 2 using InstallData or UpgradeData? <?php namespace DeviMage\CustomerAttribute\Setup; use Magento\Customer\Model\Customer; use Magento\...
Devidas's user avatar
  • 3,338
0 votes
1 answer
54 views

How can i create custom customer attribute programatically in magento 2?

Here my question is not how to create customer attribute. I want to know the running flow explanation of this process? We can create this by below code in custom module. <?php namespace Vendor\...
Mujahidh's user avatar
  • 2,791
1 vote
0 answers
117 views

Is it possible to use default Magento colorPicker in 'Update Attributes' action?

I am trying to use default Color Picker component of Magento. If I edit products individually the color picker works perfectly. Once I try the update attributes action from Catalog->Products page ...
Kieran's user avatar
  • 98
1 vote
2 answers
575 views

Magento2 - InstallData Cms Page with content from file

as the title suggests I'm creating a module that programmatically installs pages on cms_page, my problem arises when I want to load the contents of a phtml file and pass it as html into the array to ...
Orazio D'Arrigo's user avatar
2 votes
2 answers
361 views

No region found within the locale 'en' while running UpgradeData.php

I'm trying to set up 2 stores I created using InstallData script, but When I run php bin/magento setup:upgrade, I'm getting an error No region found within the locale 'en' and the process stops. What ...
Vaxo Basilidze's user avatar
0 votes
3 answers
668 views

Magento 2: Undefined variable: installer

I'm too new to Magento: i'm getting an error when setup:upgrade, here is my code: app/code/Adamsmage/Checkoutattribute/Setup/InstallData.php <?php namespace Adamsmage\Checkoutattribute\Setup; use ...
Partab Saifuddin Zakir's user avatar
0 votes
2 answers
257 views

Magento 2: Getting Error When Adding Customer Address Attribute

I'm using Magento 2.2.3, i need to add Customer Address Attribute, but when i run setup:upgrade I'm getting error of Wrong Entity ID. Here is My code: CustomerAddress\Attribute\Setup\InstallData.php ...
Partab Saifuddin Zakir's user avatar
0 votes
1 answer
415 views

Magento2: How to add new column in admin_user table?

How to add a new column in admin_user table Magento 2 ?
prabhakaran7's user avatar
  • 1,077
2 votes
1 answer
2k views

Insert multiple records to multiple custom tables through install script in magento2

I have created multiple table schema using setup script like below. Setup/InstallSchema.php namespace Vendor\Module\Setup; use Magento\Framework\Setup\InstallSchemaInterface; use Magento\...
Jafar Pinjar's user avatar
  • 1,929
1 vote
1 answer
256 views

How to add second field in registration form in Magento 2?

I added one attribute using this code but when I try to add another attribute then it is not working why? <?php namespace Icore\Module\Setup; use Magento\Customer\Model\Customer; use Magento\...
prabhakaran7's user avatar
  • 1,077
3 votes
1 answer
2k views

Magento 2 - Add Customer Attribute with Select Field

I'm trying to insert a customer attribute in magento 2 This is the InstallData script: use Magento\Framework\Setup\InstallDataInterface; use Magento\Framework\Setup\ModuleContextInterface; use ...
Pako's user avatar
  • 75
2 votes
1 answer
709 views

How this InstallData works each line in Magento 2?

My questions: I want know how this works by each and every line of code I want to add new attribute here Difference between InstallData and InstallSchema Here is InstallData.php <?php ...
prabhakaran7's user avatar
  • 1,077
3 votes
2 answers
234 views

InstallData not running (Magento 2.2.6)

I'm trying to make my module's InstallData.php work but it's not even running. Before every test i delete the module's entry from setup_module table. I thought the namespace and path were the issue, ...
Andrea Boggio's user avatar
1 vote
1 answer
84 views

Need to save data while custom module installation

I need to save some data while custom module installation. I save some static data using setup/InstallData.php. I need to process the existing order data and save it into my custom table. Is there any ...
Sammu Sundar's user avatar
3 votes
3 answers
3k views

Custom category attribute is not showing in magento2

I have created the custom attribute using the solution given here. Create Custom category Yes/No attribute magento2 The attribute is created and i can see entry in database eav_attribute table. But ...
Jafar Pinjar's user avatar
  • 1,929
0 votes
3 answers
1k views

Magento 2 Adding custom attributes InstallData.php Error

I'm trying to add a few custom customer attributes, I've created a simple module to install the attributes but my InstallData.php file keeps failing. Here's my code: <?php namespace ...
Howliee's user avatar
  • 153
2 votes
2 answers
457 views

Magento 2 + create widget via installData Script

I need to custom requirement for creating a widget via Script. but I have facing an error when try to add a widget via below script <?php namespace Test\Xyz\Setup; use Magento\Framework\Setup; ...
Yogesh's user avatar
  • 1,503
0 votes
3 answers
4k views

Force-run module install script in Magento 2

I have added some install data to my module (EAV attributes), and it doesn't look like it's working. However, I don't seem to get any relevant errors in the logs, and am a bit lost on whether the ...
Ynhockey's user avatar
  • 265
1 vote
1 answer
346 views

InstallData works only once

I'm trying to add customer attributes. By struggling, my first attribute is added thanks to this : InstallData.php <?php namespace My\Module\Setup; use Magento\Framework\Setup\...
Morgan Tartreau's user avatar
2 votes
2 answers
109 views

InstallData not working on Magento 2.1

I have an InstallData script below which works absolutely fine on Magento 2.2 but failed to install data on Magento 2.1 class InstallData implements \Magento\Framework\Setup\InstallDataInterface { ...
Verdu's user avatar
  • 1,720
0 votes
2 answers
3k views

How to manage InstallData.php File in magento 2

How can I manage my InstallData.php file when I want to create multiple attribute for customer and product? Here, in my InstallData file I have create an attribute for the product. namespace ...
Bhavisha Thaker's user avatar
2 votes
1 answer
754 views

InstallData.php not executing on Magento 2.2.1

I have the following InstallData.php in my Setup directory in my module. The script does not seem to execute at all. I have tried throwing an Exception at the beginning, dumping and dying, etc. ...
TomWilsonFL's user avatar
2 votes
1 answer
1k views

Read data from File in magento2 InstallData.php

I have my InstallData but i want to read a file in SQL/CSV format in magento 2 public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context) { $setup->startSetup(); ...
Soladogun Ilyas Ademuyiwa's user avatar
1 vote
2 answers
2k views

Custom Attribute is not saving data in database

I'm trying to add custom text box named cashback in Magento 2 product add/edit page. I added the text box programmatically. But my below code doesn't add column in the table also not saving the value. ...
Ramesh KR's user avatar
  • 866
1 vote
1 answer
71 views

Error when trying to add custom attribute programmatically

I got this error when I try to create a custom attribute for products: The configuration parameter "formElement" is a required for "instruction" field. InstallData.php <?php namespace MyVendor\...
qvasz's user avatar
  • 134
2 votes
2 answers
2k views

InstallData not working

I have InstallSchema.php as follows: <?php namespace Namespace\Module\Setup; use Magento\Framework\Setup\InstallSchemaInterface; use Magento\Framework\Setup\SchemaSetupInterface; use Magento\...
DEEP JOSHI's user avatar
0 votes
2 answers
239 views

Problem with add an attribute to Customer in magento 2

I created a module in this way: I created a vendor folder "Test1" Then I created a module folder "AddCustomerAttr" then a folder inside the module "etc" and inside "etc" I put module.xml: <?xml ...
M Taheri's user avatar
11 votes
4 answers
6k views

Difference between InstallSchema and InstallData

I want to know the difference between InstallSchema and InstallData in details. I also need to know when can I use InstallSchema.php and InstallData.php?
Ketan Borada's user avatar
  • 2,603
0 votes
1 answer
478 views

Custom Select Attribut in admin have different values set than InstallData

I'm trying to make a 3 value select attribut in the customer edit page in admin. The attribut is created in DB after setup:upgrade but stored in eav_attribute_option table as follow : the value ...
medmek's user avatar
  • 584
0 votes
1 answer
2k views

Save email template to database when install data Magento 2

I want create a new template, but not from Marketing > Email Templates i want to do it programmatically from my custom extension, the idea is the new template will be saved when Setup/InstallData.php ...
simple guy's user avatar
  • 2,484
1 vote
1 answer
74 views

InstallData categories not add the categories

I make and installData to define new categories (I have a lot of categories and sub-categories and I don't know why but they are nor added, in the database I see they are added but it's strange see ...
Kpone's user avatar
  • 371
3 votes
4 answers
14k views

Magento 2 : InstallData.php Does Not Seems to be Running While setup:upgrade

In custom module, I have InstallSchema.php and a InstallData.php files. InstallSchema.php seems to be running fine, both tables declared in file are created. But with the InstallData.php nothing ...
Gianni Di Falco's user avatar
0 votes
2 answers
5k views

Fatal error: Call to a member function create() on null

I am trying to create a customer custom attribute in Magento 2, but it's throwing an error. Fatal error: Call to a member function create() on null in Custom\Setup\InstallData.php on line 47 For ...
Bojjaiah's user avatar
  • 3,988
1 vote
0 answers
152 views

Magento 2 InstallData SOLID principles

I have to add about 100 attributes to product, but the file length is about 3000 lines.In installer I only add new attribute set, attribute group and attributes. I have attributes data in separate ...
Alex Yeremenko's user avatar
9 votes
6 answers
4k views

Magento2: Setup Script not loaded

I've been banging my head for a few hours now. I have setup a small Magento 2 module. It is enabled everything is working except the Setup scripts never run. Actually from my diagnosis right now, they ...
Michaël St-Georges's user avatar
6 votes
2 answers
13k views

How to "reload" a custom module after code changes

I've made several custom modules for i.e. adding attributes to categories. This is all the first time for me, so I set up the module the first time, enabled it and all is fine so far. But when I go ...
Asitis's user avatar
  • 1,247
0 votes
2 answers
983 views

Magento2: How to add pre defined data (installData.php) for Custom Module

I am working on creation of custom module and it is going to be stuck in a problem where i want to add some predefined data to my custom module while installation, so for that i review pre defined ...
Amit Dwivedi's user avatar
  • 1,540