Can't rei-mport component #179
Labels
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: joomla/Component-Builder#179
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
So I exported the component so a friend could work on my project. He then made changes and exported the project to give back to me but when I tried to import it I got the following error
Are the two of you on the same JCB versions?
The import file has a field "metakey" but my database doesn't. Yes we are both on the latest version 2.6.3
Ok, I'm wrong, mine is 2.6.2, let me upgrade and try again.
I did not see that coming... okay we added metakey to JCB components few update back... and it did not update your database with the new fields. I can give you a string to add, so that it dumps the metadata on import, or you can update your database to have those three new columns.
I think in the core I will add some SQL to add those fields if not found in the next update.
So here is the string to dump them for now on line 1476 of import_joomla_components.php model add these lines:
So now it stops with this error:
Unknown column 'access' in 'field list'
Should I just keep unsetting these variables?
For the meta, yes... you see it breaks on the first, so the meta stuff will still bom out once the access one is fixed.
JCB addresses new fields you create by dynamically adding it to SQL updates... but not access and metadata as yet. So when we change a view from not having metadata and not having access to now having it, JCB does not add the SQL needed to update the Database at this point. And I do not think it will be easy to detect. Hmmm painful.... I will have to spend some time on this, to build a stable fix.
Okay so for now yes the metadata stuff must be unset. Let me just check what table was changed with regards to access... so much for trying to keep the JCB packages backward compatible.
I will give you some more code in a moment.
You do realize we are doing almost the impossible here right! I mean to move a component from one JCB to another is like a crazy complex nightmare...
Since we are not only moving the Joomla Component but all the data down to the field types... and updating all the id relationships to now remap to the new JCB component. The more I work with this area... the more I am thinking it is almost just as much madness as the compiler...lol
Hang in there, this will probably be one of the most used features by me because I have a small shop of developers and in this case I started work on the component then I gave it to one of my developers to finish and now he's giving it back to me completed.
I know it is an amazing feature, and I also need it to work flawless...
Here you can see the blame game...
Okay so for now unset access and metadata for all tables, since access it not so major player if you are working as Super User in Joomla. So on line 1236 of import_joomla_components.php add the following in:
Then you don't need to add the previous unset code. Metadata is anyway not yet being used in JCB 👍
Ok, the import worked after that change and also the config section is correct this time as well. Maybe it has something to do with my database being different than what it should be when I did the export because my developer installed 2.6.3 for the first time while I've been constantly upgrading since the 2.5.x series
Yea that is why, I mean the DB's did change, yet only slightly...
You should know the JCB package export and import is now more stable and accurate then it ever was before. I spend weeks on it since I use it extensively with all my clients and projects.
So if you run into any more issues on it please report it straight away, to insure we keep it stable 👍