Skip Navigation

[Resolved] importing checkboxes – value is always "1" untill saving the post again

This support ticket is created 4 years, 2 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 3 replies, has 2 voices.

Last updated by Luo Yang 4 years, 2 months ago.

Assisted by: Luo Yang.

Author
Posts
#1815665

I am following this documentation: https://toolset.com/course-lesson/import-csv-ultimate-csv-importer-plugin/
in order to import data into a custom pot type called hoses. the posts are displayed in an archive style view here: hidden link

a few of the fields of the posts are check boxes, with one or more values sometimes checked. One example is the field "application" which can be see in the archive above. Some values for these checkboxes are "AIR" and "VACUUM". both the name of the field and the value stored are the same, see here: hidden link

The problem is that when I import a CSV, the values display on the front end as "1" rather than the values they are supposed to
see here: hidden link

you'll notice that the first record does indeed display the correct values. this is because if you look at / edit the post on the back end the correct check boxes are indeed checked after the import, and if you click on the "update" button, the correct values will then also be displayed on the front end. let me demonstrate what i mean in a video: hidden link

In short, after CSV import the value "1" is always displayed until that individual post is updated again - at which point, the correct values are displayed. obviously, I need the correct values to display immediately after import, and can not go through and individually re-save each post.

here is a simplified example CSV, with only one row and only the two of the checkbox fields. using this for import causes the same problem. hidden link

to evaluate this problem you'll likley need to log in TO DO SO CLICK HERE: hidden link

please note, this is sort of related to this other topic, as they are both problems with the ultimate CSV importing integration: https://toolset.com/forums/topic/imorting-repeating-field-groups-not-working/ but it is a different problem, so i opened a new ticket.

#1817605

Hello,

Same as your previous thread, it is a compatibility issue, please provide the latest version of "Ultimate CSV Importer" plugin, grant the access to your shared Google drive disk link, I need to duplicate the same problem in my localhost, thanks

#1818313

i have granted you access, and changed the link so that anyone with a link can view. sorry about that hidden link

#1819799
hose.JPG

I have tried it in my localhost with a fresh WP installation + the "WP Ultimate CSV Importer - Custom Fields Import" version 2.0.5 you provided above + the latest version of Toolset plugins.

With below steps:
1) Export the Toolset Types setting file from your website:
hidden link

2) Import it to my localhost

3) Import the csv file you provided above:
hidden link

4) Create a content template for single "Hose" post, display the same shortcode as your website:
[types field='application' format='FIELD_VALUE' separator=', '][/types]

Test those single "Hose" post in front-end, it works fine, and display the field value correctly, see my screenshot hose.JPG

so the problem you mentioned above is abnormal, please check these:
1) Make sure you are using the latest version of Toolset plugins, you can download them here:
https://toolset.com/account/downloads/

2) In case it is a compatibility problem, deactivate all other plugins, and switch to wordpress default theme 2020, deactivate all custom PHP/JS code snippets, and test again

3) Also check if there is any PHP/JS error in your website:
https://toolset.com/documentation/programmer-reference/debugging-sites-built-with-toolset/