Custom Code snippet used in Admin View MySQL Tab not exported/imported when component in development is transfered #600

Closed
opened 2020-09-17 12:58:03 +00:00 by duetnet · 2 comments
duetnet commented 2020-09-17 12:58:03 +00:00 (Migrated from github.com)

PLEASE NOTE : This is NOT a major problem, just thought you might want to know that this is happening.

Steps to reproduce the issue

Step 1 : Create custom code snippet called "sqlAvInstall"

Coded as follows:

-- Dumping data for table #__[[[component]]]_[[[view]]]
TRUNCATE #__[[[component]]]_[[[view]]];
INSERT INTO #__[[[component]]]_[[[view]]]

Step 2: I then add this custom code placeholder into Admin View "mytable" MYSQL Tab. e.g.

[CUSTOMCODE=sqlAvInstall]
(id, alias, etc.........) VALUES
(1,'abc',etc......);

Step 3: If I compile component, the code in install.mysql.utf8.sql is correctly updated and is shown as:

-- Dumping data for table #__mycomponent_mytable
TRUNCATE #__mycomponent_mytable;
INSERT INTO #__mycomponent_mytable
(id, alias, etc.........) VALUES
(1,'abc',etc......);

Step 4: I export component from System A, Import component into system B.

Expected result

SQL Custom code snippet IS exported from System A and imported into System B.

Actual result

SQL Custom code snippet IS NOT imported into System B.

System information (as much as possible)

Not particularly relevant as this happens on all browsers in Win10 and has been happening with JCB ever since I started applying this functionality specifically to the Admin View SQL Tab about 6 months ago.

Additional comments

For each admin view in my component, I create an SQL upload of demonstration/test data on install, but the "custom code" for the SQL commands is not exported from the source system and/or imported into the target system.

I have to manually recreate this custom code each time I transfer the component to a new development environment.

**PLEASE NOTE :** This is NOT a major problem, just thought you might want to know that this is happening. ### Steps to reproduce the issue Step 1 : Create custom code snippet called "sqlAvInstall" Coded as follows: -- Dumping data for table `#__[[[component]]]_[[[view]]]` TRUNCATE `#__[[[component]]]_[[[view]]]`; INSERT INTO `#__[[[component]]]_[[[view]]]` Step 2: I then add this custom code placeholder into Admin View "mytable" MYSQL Tab. e.g. [CUSTOMCODE=sqlAvInstall] (`id`, `alias`, etc.........) VALUES (1,'abc',etc......); Step 3: If I compile component, the code in install.mysql.utf8.sql is correctly updated and is shown as: -- Dumping data for table `#__mycomponent_mytable` TRUNCATE `#__mycomponent_mytable`; INSERT INTO `#__mycomponent_mytable` (`id`, `alias`, etc.........) VALUES (1,'abc',etc......); Step 4: I export component from System A, Import component into system B. ### Expected result SQL Custom code snippet IS exported from System A and imported into System B. ### Actual result SQL Custom code snippet IS NOT imported into System B. ### System information (as much as possible) Not particularly relevant as this happens on all browsers in Win10 and has been happening with JCB ever since I started applying this functionality specifically to the Admin View SQL Tab about 6 months ago. ### Additional comments For each admin view in my component, I create an SQL upload of demonstration/test data on install, but the "custom code" for the SQL commands is not exported from the source system and/or imported into the target system. I have to manually recreate this custom code each time I transfer the component to a new development environment.

Hmm it seems we have a table column that I am not searching for custom code, can you give me the exact view/table, and column where you added this custom code placeholder? So I can check 👍

I did link the search and the compile versions to be the same, but it could be that we missed something. I would like to make sure it is perfect, so let me know.

Hmm it seems we have a table column that I am not searching for custom code, can you give me the exact view/table, and column where you added this custom code placeholder? So I can check :+1: I did link the search and the compile versions to be the same, but it could be that we missed something. I would like to make sure it is perfect, so let me know.

I took another look at this, and realized I did not read your post carefully enough.

Okay so here is the issue, we do not move SQL with the JCB packages, and this was mostly do to the fact that we can't remap those ID's, if there where any ID's. So the decision was made to just dump all SQL values, and not move them.

We can change this to at-least move the admin view install SQL if set. So I will push this out, moving the table option will still be nearly impossible, and dangerous seeing that if the Joomla instance where you move the JCB package does not have that table, it will break the compiler. But I am open for ideas.

I took another look at this, and realized I did not read your post carefully enough. Okay so here is the issue, we do not move SQL with the JCB packages, and this was mostly do to the fact that we can't remap those ID's, if there where any ID's. So the decision was made to just dump all SQL values, and not move them. We can change this to at-least move the admin view install SQL if set. So I will push this out, moving the table option will still be nearly impossible, and dangerous seeing that if the Joomla instance where you move the JCB package does not have that table, it will break the compiler. But I am open for ideas.
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: joomla/Component-Builder#600
No description provided.