Support has been upgraded!
The Support Forum is closed. Not to worry! Providing the top quality support you expect and we're known for will continue! We're not ending support, just changing where you submit requests. This will provide you with the best experience possible.
Premium Support
Have you purchased an addon for Connections such as one of our premium templates or extensions with a valid license and you need help?
Please open a Support Ticket in your user account.
Free Support
Are you using the free Connections plugin? Don't worry, you are still very important to us! We are still providing you with the same high quality support that we're known for.
Please open a new support topic in the WordPress support forums for Connections.
Tagged: 8.37, csv import, extension
- This topic has 16 replies, 3 voices, and was last updated 3 years, 3 months ago by
Steven Zahm.
-
AuthorPosts
-
02/26/2019 at 9:12 am #485664
Steven Zahm
Keymaster@ Craig
After a very quick look at the CSV code and the code snippet for the custom fields registration/csv import…
You are going to have to tweak the code for the
cncsv_process_import()
function.Your CSV file only contains the org code, during import, this will update remaining fields with
''
(no content). What you need to do is first check if the field exists, then pull its value adding a (let’s call it a) meta array and then pass that meta array to thecnEntry_Action::meta()
method.Alternatively, you could just make sure to include all the custom fields in your update CSV file.
I’m actually making the same error in the CSV Import addon when it comes to the bio and note field (several more actually). If the bio field does not exist in the CSV file the entry updates with an empty string.
I made a tweak to the code of CSV Import addon on your site, untested, but should resolve the issue with the bio field. I do an
array_key_exists( 'bio', $data )
check before setting the bio/notes.Run tow small/quick tests. Import a fresh entry to make show everything imports as expected. The do an update CSV file, just like the one you attached, but only for the new entry. Make sure it updates correctly.
Hope this helps! Let me know.
02/26/2019 at 4:11 pm #485683CRAIG HALLER
ParticipantThis reply has been marked as private.02/27/2019 at 9:29 am #485772Steven Zahm
Keymaster@ Craig
You still need to map the Organization field otherwise the row will be skipped.
Also, when testing, like I suggested, create a CSV file with a single row. Then if you get the result your are seeking, do the rest.
Give it another test, updating the notes only so I know for sure my tweak to the import process does not remove the bio field. It should import fine, updating just the notes leaving the bio unchanged. If I can get confirmation, I can roll the change into the plugin so it is included in the next update.
Example test CSV, only one row:
Entry ID Organization Org Code Notes
Do not map, the org code.
02/27/2019 at 6:12 pm #485791CRAIG HALLER
ParticipantSorry for the delay, it’s a chemo day for me (hence sometimes a bit foggy).
I tried with one line (in addition to the header) and two lines since only one entry (Haller Academy) has values in my custom fields.
Neither upload wrote the notes field.
Neither upload erased the bio field.
Both uploads deleted custom fields.
See screen shots.
Feel free to do ANYTHING in my site for your own testing, etc. I have backups and the site is not yet being used. You have my permission.
-Craig
Attachments:
You must be logged in to view attached files.02/28/2019 at 1:40 pm #485867Steven Zahm
Keymaster@ Craig
I was in the middle of working on this when, I think, my temp admin account expired. Could you please reset the expiration? Right now, the CSV Import addon is in a broken state and will not function.
02/28/2019 at 1:44 pm #485868CRAIG HALLER
ParticipantOoops. Extended it for a week, should be all set.
-C02/28/2019 at 2:41 pm #485869Steven Zahm
Keymaster@ Craig
Ok, I do believe this works as you need now. I also took liberty updating the custom fields code snippet so you should be able to update one or more of them without the others being deleted (unless the field exists in the CSV file and is empty, same for bio and notes).
Give it a some testing. Hope this helps!
-
AuthorPosts
You cannot reply to this support topic. Please open your own support topic.