Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

The tag has no usage guidance.

0
votes
3answers
38 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 ...
1
vote
2answers
52 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; ...
0
votes
0answers
19 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 ...
1
vote
1answer
42 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\...
2
votes
2answers
57 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 { ...
0
votes
2answers
173 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 ...
0
votes
0answers
33 views

Custom tab + Custom Attribute * ui_component

So i have made a custom tab in the customer form customer_form.xml <form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:...
2
votes
1answer
170 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. ...
2
votes
1answer
167 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(); ...
0
votes
2answers
666 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. ...
0
votes
0answers
31 views

Magento 2.1.8 doesnt seem to run InstallData.php

I´m having exactly the same problem as described here: Magento 2 : InstallData.php Does Not Seems to be Running While setup:upgrade I tried using the code from the first solution, but the EAV ...
1
vote
1answer
40 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\...
1
vote
2answers
275 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\...
0
votes
2answers
78 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 ...
7
votes
4answers
1k 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?
0
votes
1answer
272 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 ...
0
votes
1answer
378 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 ...
1
vote
1answer
42 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 ...
0
votes
2answers
4k 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 ...
0
votes
2answers
711 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 ...
1
vote
0answers
68 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 ...
4
votes
5answers
1k 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 ...
5
votes
2answers
6k 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 ...
0
votes
2answers
778 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 ...