Skip to content
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

Importing checkbox grouped fields don't work #22

Open
andrewlimaza opened this issue Jul 10, 2019 · 2 comments
Open

Importing checkbox grouped fields don't work #22

andrewlimaza opened this issue Jul 10, 2019 · 2 comments

Comments

@andrewlimaza
Copy link
Collaborator

Import Users From CSV does not support checkbox_grouped fields for Register Helper.

On export, it is a comma-separated list but trying to import that same value does not work. It never updates the values.

@VR51
Copy link

VR51 commented Aug 26, 2020

This still seems to be an issue. Did you find a solution for it?

I wonder, will this arrays Gist work https://gist.github.com/andrewlimaza/50a3d1ab70c09428b6236fa35a932c0d ?

I will probably test it tomorrow.

@VR51
Copy link

VR51 commented Aug 28, 2020

The gist linked in my above comment resolves this issue.

The only problem is that user meta held in an array for a PMPro grouped checkbox field is exported to CSV with a space after each comma between each value in the array. This means anyone who inspects the PMPro export file to see how data in grouped checkbox fields should be formatted for import will fail their import attempt because of the extra space. Also, anyone who exports user data from PMPro in order to import it into another site (or back into the source site) will not see any grouped checkbox fields imported.

For example,

Exported user data in a grouped checkbox field that holds a list of fruits is exported as "apple, banana, cherry" whereas it needs to be exported by PMPro as "{apple,banana,cherry}" in order for it to import correctly i.e. no space after the comma.

If the Gist is added into the importer plugin maybe you could update the PMPro user exporter to automatically wrap array data in curly braces (as required by the Gist) and to remove the space between values or maybe update the gist so explode at ', ' (comma-space).

Thanks for the Gist, Andrew, and thanks for all your work on PMPro Import Users from CSV.

Lee

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants