- Posts: 81
- Thank you received: 0
SQL code to create custom fields
- Ahmad Arshad
- Topic Author
- Away
- Premium Member
Less
More
2 years 7 months ago #146223
by Ahmad Arshad
SQL code to create custom fields was created by Ahmad Arshad
Dear Tuan,
When we install the membership pro component, it automatically creates a number of custom fields...
I am trying to make a plugin that creates / deletes custom fields as part of the installation and uninstall process..
Can you point me to the right area ?
When we install the membership pro component, it automatically creates a number of custom fields...
I am trying to make a plugin that creates / deletes custom fields as part of the installation and uninstall process..
Can you point me to the right area ?
Please Log in or Create an account to join the conversation.
- Tuan Pham Ngoc
- Offline
- Administrator
2 years 7 months ago #146224
by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic SQL code to create custom fields
The custom fields are stored in #__osmembership_fields table. So I guess somehow, you will have to insert data into that table manually
Not sure if it gives you the information? Or you want to know something else?
Tuan
Not sure if it gives you the information? Or you want to know something else?
Tuan
Please Log in or Create an account to join the conversation.
- Ahmad Arshad
- Topic Author
- Away
- Premium Member
Less
More
- Posts: 81
- Thank you received: 0
2 years 7 months ago #146230
by Ahmad Arshad
Replied by Ahmad Arshad on topic SQL code to create custom fields
Thanks Tuan,
I am guessing they get populated as part of install.sql script or something. I just wanted to look at that and maybe copy it for the ones that I want to install
I am guessing they get populated as part of install.sql script or something. I just wanted to look at that and maybe copy it for the ones that I want to install
Please Log in or Create an account to join the conversation.
- Tuan Pham Ngoc
- Offline
- Administrator
2 years 7 months ago #146231
by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic SQL code to create custom fields
Yes. It is included in administrator/components/com_osmembership/sql/fields.osmembership.sql file. And during the install/upgrade process, we check and if there are no fields in the table, execute that script to insert these default fields.
Something like that
Regards,
Tuan
Code:
$coreFieldsSql = JPATH_ADMINISTRATOR . '/components/com_osmembership/sql/fields.osmembership.sql';
OSMembershipHelper::executeSqlFile($coreFieldsSql);
Something like that
Regards,
Tuan
Please Log in or Create an account to join the conversation.
Support
Documentation
Information
Copyright © 2024 Joomla Extensions by Joomdonation. All Rights Reserved.
joomdonation.com is not affiliated with or endorsed by the Joomla! Project or Open Source Matters.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.