Skip Navigation

[Resolved] custom user checkbox field saves value differently to the way the WP admin does

This support ticket is created 8 years 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 10:00 - - - - -
- - - - - - -

Supporter timezone: Africa/Cairo (GMT+02:00)

This topic contains 17 replies, has 3 voices.

Last updated by Mohammed 7 years, 10 months ago.

Assisted by: Mohammed.

Author
Posts
#392209

I have a custom user field called wpcf-tender-notifications. It is a checkbox field. When a user registers on my site they have the opportunity to select checkboxes and save it to their profile(using a cred user form).
These fields then trigger email notifications in a plugin we custom built. A week or so ago the emails stopped sending out so I started investigating. Eventually I tracked down the problem being the way the CRED edit form now saves those checkboxes. for some reason it is saving the field as this in the database:

 s:64:"wpcf-fields-checkboxes-option-5b82e137601d5bc2447663b54099ea12-1";s:25:"advertising-and-marketing";s:64:"wpcf-fields-checkboxes-option-02c9942f4b036ec2b337a2589172e739-1";s:35:"architecture-design-and-engineering";s:64:"wpcf-fields-checkboxes-option-d5ce8d67af5242872670a8e2d3c76d6a-1";s:25:"automotive-and-mechanical";s:64:"wpcf-fields-checkboxes-option-d32ab8b060e10b46a1a0101f48a89b53-1";s:25:"cleaning-and-pest-control";s:64:"wpcf-fields-checkboxes-option-67c1cac04823b12a61961609ef94ec6d-1";s:16:"computers-and-it";s:64:"wpcf-fields-checkboxes-option-30c64055dfa22250be9ae228da06b56a-1";s:12:"construction";s:64:"wpcf-fields-checkboxes-option-8f4c9b54ee1242d54876248d1f5bd62f-1";s:21:"courier-and-transport";s:64:"wpcf-fields-checkboxes-option-431e17a1d7ef0d5a5821bc5d99cd0612-1";s:7:"farming";s:64:"wpcf-fields-checkboxes-option-6c24ef8289569decfbc78d6f72af98ba-1";s:22:"finance-and-accounting";s:64:"wpcf-fields-checkboxes-option-ca9653ba175bf1442d287f53e94379f9-1";s:21:"gardening-landscaping";s:64:"wpcf-fields-checkboxes-option-6ba7140c646dc45240361cc86429a400-1";s:18:"health-and-fitness";s:64:"wpcf-fields-checkboxes-option-a9cd98e0f3b50f74e5d237e158a2745b-1";s:5:"legal";s:64:"wpcf-fields-checkboxes-option-e11c71f684f34043df27bd2c3c5022a7-1";s:18:"othermiscellaneous";s:64:"wpcf-fields-checkboxes-option-8d9603af61711dbb861a125bff006732-1";s:21:"part-time-and-student";s:64:"wpcf-fields-checkboxes-option-93f92e03651fd2c2a0a1e664421bd05d-1";s:11:"photography";s:64:"wpcf-fields-checkboxes-option-99bce127654ff18355e1c13fc13c3c4a-1";s:8:"security";s:64:"wpcf-fields-checkboxes-option-2e78bdfac14bdd43a0479a2e3ff7c0dc-1";s:7:"storage";}

If I go to the same user account and simply save his account in the WordPress admin without making any changes whatsoever and then go look at the same filed in the DB it is suddenly stored as:

a:17:{s:64:"wpcf-fields-checkboxes-option-5b82e137601d5bc2447663b54099ea12-1";a:1:{i:0;s:25:"advertising-and-marketing";}s:64:"wpcf-fields-checkboxes-option-02c9942f4b036ec2b337a2589172e739-1";a:1:{i:0;s:35:"architecture-design-and-engineering";}s:64:"wpcf-fields-checkboxes-option-d5ce8d67af5242872670a8e2d3c76d6a-1";a:1:{i:0;s:25:"automotive-and-mechanical";}s:64:"wpcf-fields-checkboxes-option-d32ab8b060e10b46a1a0101f48a89b53-1";a:1:{i:0;s:25:"cleaning-and-pest-control";}s:64:"wpcf-fields-checkboxes-option-67c1cac04823b12a61961609ef94ec6d-1";a:1:{i:0;s:16:"computers-and-it";}s:64:"wpcf-fields-checkboxes-option-30c64055dfa22250be9ae228da06b56a-1";a:1:{i:0;s:12:"construction";}s:64:"wpcf-fields-checkboxes-option-8f4c9b54ee1242d54876248d1f5bd62f-1";a:1:{i:0;s:21:"courier-and-transport";}s:64:"wpcf-fields-checkboxes-option-431e17a1d7ef0d5a5821bc5d99cd0612-1";a:1:{i:0;s:7:"farming";}s:64:"wpcf-fields-checkboxes-option-6c24ef8289569decfbc78d6f72af98ba-1";a:1:{i:0;s:22:"finance-and-accounting";}s:64:"wpcf-fields-checkboxes-option-ca9653ba175bf1442d287f53e94379f9-1";a:1:{i:0;s:21:"gardening-landscaping";}s:64:"wpcf-fields-checkboxes-option-6ba7140c646dc45240361cc86429a400-1";a:1:{i:0;s:18:"health-and-fitness";}s:64:"wpcf-fields-checkboxes-option-a9cd98e0f3b50f74e5d237e158a2745b-1";a:1:{i:0;s:5:"legal";}s:64:"wpcf-fields-checkboxes-option-e11c71f684f34043df27bd2c3c5022a7-1";a:1:{i:0;s:18:"othermiscellaneous";}s:64:"wpcf-fields-checkboxes-option-8d9603af61711dbb861a125bff006732-1";a:1:{i:0;s:21:"part-time-and-student";}s:64:"wpcf-fields-checkboxes-option-93f92e03651fd2c2a0a1e664421bd05d-1";a:1:{i:0;s:11:"photography";}s:64:"wpcf-fields-checkboxes-option-99bce127654ff18355e1c13fc13c3c4a-1";a:1:{i:0;s:8:"security";}s:64:"wpcf-fields-checkboxes-option-2e78bdfac14bdd43a0479a2e3ff7c0dc-1";a:1:{i:0;s:7:"storage";}}

And then the notification emails in our plugin also trigger as they should for that user.

Is this a bug we have spotted? It doesnt make sense that the cred form would save the data differently to how the wp user edit screen does...

Please advise

#392212

Just to simplify things I saved only one checkbox to the field using the CRED form and it saved as:

 a:1:{s:64:"wpcf-fields-checkboxes-option-5b82e137601d5bc2447663b54099ea12-1";s:25:"advertising-and-marketing";}

Then I saved the user record in WP admin (not changing anything) and the field value changed to:

 a:1:{s:64:"wpcf-fields-checkboxes-option-5b82e137601d5bc2447663b54099ea12-1";a:1:{i:0;s:25:"advertising-and-marketing";}}
#392393

Dear johan,

Thanks for the details, I can duplicate same problem in my localhost, and put it into our to-do list, our developers will take care of it.

#392428

To be fixed in new release? any ETA?

#393079

Hello Johan,

I’m Mohammed Toolset support second tier and I have been escalated to this thread. I’ll give my best to help you to achieve your needs through Toolset components.

Thank you very much for reporting this.
I'm working on the issue. please wait and I will get back t you soon.

Thanks.

#394607

Hi is there any feedback on this yet?

#394976

Hi Johan,

Thank you for your patience.

I'm still working on the issue. please wait and I will get back to you soon.

Thanks.

#395004

Hi Johan,

This is an update that the issue is reported to the development team.

They will work on it and I will notify you once I get any updates.

Thanks.

#395005

Thanks

#399832

Any feedback?

#399836

Hi Johan,

The issue is already reported to the development team.

They decided to move CRED to the way Types store its fields.

About the progress, this is still on the waiting list.so, please wait and will inform you of the updates.

Thanks.

#401602

Hi Johan,

Thank you for your patience and sorry for the waiting time.

As I mentioned before, we decided to make CRED saves fields like the way Types does.

And this is an update that this will be fixed in the next CRED release.

Please keep following this thread and I will inform you once we launch the new release.

Thanks.

#406899

Any date for this release yet?

#406938

Hi Johan,

We already launched a new Toolset release.

Please backup your website and update all toolset plugins to the latest versions then test the issue.

I'm waiting for your relpy.

Thanks.

#406939

You said it would be a CRED update. CRED seems to be the same version as the last few months.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.