Skip Navigation

[Resolved] The Fields in User’s just say ARRAY when you try to save them.

This thread is resolved. Here is a description of the problem and solution.

Problem:
All User Fields in Dashboard > User > Edit that I created with Types are displaying "Array" instead of what I saved for them.

Solution:
This is solved in: Types 2.2.8
You will need to re-save all the users fields with new values in case you updated them during the presence of the BUG, as now in the Database you lost the previously saved value.

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

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
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Tagged: 

This topic contains 4 replies, has 2 voices.

Last updated by Beda 7 years, 2 months ago.

Assisted by: Beda.

Author
Posts
#483162
0002.jpg

I am trying to: Update User Feilds

I visited this URL: hidden link

I expected to see: User fields that were saved

Instead, I got: ARRAY where the field is supposed to be.

It says array on the user page in Admin as well.

#483208

Yes, I am aware of that and already reported it to the Developers, and tryed to debug it today, but could not yet find a solution.

I will keep you updated and want to point out that I am completely aware of the urgency of this topic.

#483218

OK, I know this is unconventional, but I will post here the solution as I found it.

An additional action for Checkboxes has been introduced, and it's right now running ALWAYS, no matter if the field IS or IS NOT a checkboxes field.

So the solution, for now, can be to edit your Types PHP Files with a tiny change.

1. Head to types/library/toolset/types/embedded/includes and locate the file "usermeta-post.php", line 399:

wpcf_update_checkboxes_field( $field_definition_array, 'user', $user_id, $wpcf_form_data );

2. Please replace that line with:

if ($field_definition_array['type'] == 'checkboxes') {
  wpcf_update_checkboxes_field( $field_definition_array, 'user', $user_id, $wpcf_form_data );
}

This solves the problem

IF you already did save any User with this faulty code, the values you saved previously are GONE.
You have to re-save the user after applying above code and RE_ENTERING the values 🙁

This is because the faulty code updated the database with an empty array for each user you updated.

My fix should be safe, but please acknowledge this is not an official patch.
This will have to be approved first by the DEV on Monday.

#483363

Thank You, that solved it.

#483491

This is the official erratum:
https://toolset.com/errata/types-saves-an-invalid-value-in-user-fields/

Please re-install Types and apply that patch (it's basically the same check as my above code but in another place)

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