-
-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Import from zip file with CSV files - mapping to table ids #145
Comments
Hi @Principia4834, thanks for your work on this! I'll take a look as soon as possible, and I'll be more than happy to integrate this into TablePress directly if everything works fine! Best wishes, |
Hi @Principia4834, I added such a feature (after some modifications to not break existing behavior) in commit 0074297. Best wishes, |
Hi @Principia4834, to add on, I added one more modification, in commit 8983b6e: As the table name is not unique, replacing of the table will only be done, if there was exactly one match of table name and file name. Otherwise (no matching table or more than one match), the file will be imported as a new table. This way, no possibly "wrong" tables will be replaced accidentally. Regards, |
Tobias
So it all looks good to me. |
Hi @Principia4834, great! Thanks for testing this! This confirms my tests, so that we can ship this, I think :-) Best wishes, |
Tobias
Thank you for all your work on the plugin which works really well. I have a site with multiple tables that are created from CSV files that my users frequently re-import. I would like to do a bulk import that replaces existing tables. I see that controller-admin.php has a "TODO" comment against this functionality and that by default new tables are created even if the "replace" option is selected on the Import page. I have written a possible implementation which uses the CSV file name to find the table id. I use the table name to hold the CSV file name so I can do the match - case sensitive and exact.
I've attached the changed controller-admin.php - this is the first time I've written php so it may not be the best solution. Changes are at lines 1156 to 1164 and line 1183 in the function handle_post_action_import. I've removed your "TODO" comment.
It would be great if you could consider this change for a future release - for me and my users it's a real convenience enhancement and helps automate our site update processes.
Andy
controller-admin.zip
The text was updated successfully, but these errors were encountered: