Import ignores Created By field data #944
Labels
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: joomla/Component-Builder#944
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
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?
Steps to reproduce the issue
Create Component with an admin view
Enter some data
Export the data (using the standard Export Data button on the admin view)
Delete all data from the view/table
Import the data (using the file just exported)
Expected result
The data in the "Created By" field should use the data provided in the import.
Actual result
Uses the current user's ID (the person doing the import) as the Created By.
System information (as much as possible)
Additional comments
I understand that having the created_by field use the data provided in the import might cause a problem (if the user IDs are different - esp. when moving from one system to another); however, the fact that the import field selection allows you to set the created_by field to the created_by import filed would imply to me that it should be using that data directly, without making any changes to it.
At this point I don't see a way around this (other than modifying the JCB code).
Am I missing a setting somewhere that would allow it to just import the raw data from the import file?
I guess an ideal solution might be to have an option for that field to allow:
Let me know if I missed something here, or if this is a somewhat simple change that I could make and submit.
(BTW ... if anyone runs into this issue, the work-aroudn is just to do the import directly using the db manager)
Yes, this is a feature... and so it forces the created_by to use the current user doing the import, to avoide all kinds of other issues. This field is a strong control field in Joomla, so changing that behaviour will be a security risk, therfore can not be the default.
But I get the point that it may be what end-users want, and so we developers must give it to them. Okay so it seems like a feature request. I will mark it like that and see when we can get back to it.
Yes, I see that importing that data directly could cause a problem.
And after looking more closely at the export data it's also missing the asset-id field. And I realized re-importing that would lead to problems also.
I think I'm just trying to do something that is different than an 'export' of data, and it's specifically related to development - not end-user purposes.
I think the existing system is good, but maybe just change the selector on that import field for the created_by field to just be set to 'current user' so that the person importing knows that it won't be imported from the original data.
The real 'issue' that I was having was that I needed to uninstall the component before re-building and re-installing (beause I messed up something in the data fields), and I didn't want to loose the data in the tables.
Maybe the easiest solution is if we had a way to specify that on uninstall the tables aren't deleted.
I seem to remember seeing that mentioned in a video a long time ago but couldn't find it.
If you happen to remember which video I'll just go back there and find it and that would solve my issue.