Skip Navigation

[Resolved] PHP Warnings with preg_match() and strlen() when using Forms and Types

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

Problem:

We're getting the following warnings when using Types to create a custom post type and Toolset Forms to create a form that adds data to the custom post type

Solution:

It is a known issue, see our errata:

https://toolset.com/errata/toolset-form-doesnt-save-checkboxes-field-values/

Relevant Documentation:

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

Our next available supporter will start replying to tickets in about 1.25 hours from now. Thank you for your understanding.

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 2 replies, has 2 voices.

Last updated by cortJ 4 years, 11 months ago.

Assisted by: Luo Yang.

Author
Posts
#1423663

We're getting the following warnings when using Types to create a custom post type and Toolset Forms to create a form that adds data to the custom post type:

PHP Warning:  preg_match() expects parameter 2 to be string, array given in /site/wp-includes/class-wp-block-parser.php on line 417
PHP Warning:  strlen() expects parameter 1 to be string, array given in /site/wp-includes/class-wp-block-parser.php on line 489

We tested in a form containing custom fields with single line, multiple line, select, checkbox, radio, and checkboxes. The warnings occur only when there's a checkboxes field, and also the checkboxes values are not saved when I go to the edit post area. If I create a form without checkboxes but the other aforementioned fields, I don't get the warning and the data appears to be saved correctly.

Has this issue in forms/types been identified? If yes, when can we expect a fix?

#1424329

Hello,

It is a known issue, see our errata:
https://toolset.com/errata/toolset-form-doesnt-save-checkboxes-field-values/

Please try the fix in above errata and test again.

#1425029

My issue is resolved now. Thank you!