Skip Navigation

[Closed] Critical Error with php update

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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 2 replies, has 2 voices.

Last updated by Minesh 1 year, 7 months ago.

Assisted by: Minesh.

Author
Posts
#2612353

Hi there,

I recently updated my site to php 8.2, and ever since i've been getting a critical error when trying to view the details of a custom post. This is the error message I get when trying to view:

Fatal error: Uncaught TypeError: abs(): Argument #1 ($num) must be of type int|float, string given in /usr/www/users/saidrejdad/wp-content/plugins/cred-frontend-editor/vendor/toolset/toolset-common/lib/adodb-time.inc.php:1048 Stack trace: #0 /usr/www/users/saidrejdad/wp-content/plugins/cred-frontend-editor/vendor/toolset/toolset-common/lib/adodb-time.inc.php(1048): abs('2023-05-29 06:4...') #1 /usr/www/users/saidrejdad/wp-content/plugins/types/vendor/toolset/types/embedded/includes/fields/date.php(320): adodb_date('H', '2023-05-29 06:4...') #2 /usr/www/users/saidrejdad/wp-includes/class-wp-hook.php(308): wpcf_fields_date_value_get_filter('2023-05-29 06:4...', Object(WP_Post)) #3 /usr/www/users/saidrejdad/wp-includes/plugin.php(205): WP_Hook->apply_filters('2023-05-29 06:4...', Array) #4 /usr/www/users/saidrejdad/wp-content/plugins/cred-frontend-editor/vendor/toolset/toolset-common/toolset-forms/classes/class.field_factory.php(92): apply_filters('wpcf_fields_typ...', '2023-05-29 06:4...', Object(WP_Post)) #5 /usr/www/users/saidrejdad/wp-content/plugins/cred-frontend-editor/vendor/toolset/toolset-common/toolset-forms/classes/class.date.php(59): FieldFactory->getValue() #6 /usr/www/users/saidrejdad/wp-content/plugins/cred-frontend-editor/vendor/toolset/toolset-common/toolset-forms/classes/class.form_factory.php(309): WPToolset_Field_Date->metaform() #7 /usr/www/users/saidrejdad/wp-content/plugins/cred-frontend-editor/vendor/toolset/toolset-common/toolset-forms/bootstrap.php(66): FormFactory->metaform(Array, 'wpcf[registrati...', Array) #8 /usr/www/users/saidrejdad/wp-content/plugins/cred-frontend-editor/vendor/toolset/toolset-common/toolset-forms/api.php(25): WPToolset_Forms_Bootstrap->field('post', Array, Array) #9 /usr/www/users/saidrejdad/wp-content/plugins/types/vendor/toolset/types/embedded/includes/fields-post.php(276): wptoolset_form_field('post', Array, Array) #10 /usr/www/users/saidrejdad/wp-content/plugins/types/vendor/toolset/types/embedded/admin.php(105): wpcf_add_meta_boxes('member', Object(WP_Post)) #11 /usr/www/users/saidrejdad/wp-includes/class-wp-hook.php(308): wpcf_admin_add_meta_boxes('member', Object(WP_Post)) #12 /usr/www/users/saidrejdad/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters(NULL, Array) #13 /usr/www/users/saidrejdad/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #14 /usr/www/users/saidrejdad/wp-admin/includes/meta-boxes.php(1701): do_action('add_meta_boxes', 'member', Object(WP_Post)) #15 /usr/www/users/saidrejdad/wp-admin/edit-form-blocks.php(276): register_and_do_post_meta_boxes(Object(WP_Post)) #16 /usr/www/users/saidrejdad/wp-admin/post.php(187): require('/usr/www/users/...') #17 {main} thrown in /usr/www/users/saidrejdad/wp-content/plugins/cred-frontend-editor/vendor/toolset/toolset-common/lib/adodb-time.inc.php on line 1048

I've tested it offline on an older version of php and it seems to work fine, but I can't roll back the live site as the hosting provider doesn't provide php older than 8.0

Is there any way I can remedy this error?

#2612421

So after investigating a bit more, I've discovered the error was caused by gravity forms storing dates in the database as YY/MM/DD and Toolset looking for a UNIX timestamp, and when it doesn't find one it causes the page to crash.

I'm attempting to try fix it by using the response from the thread here:

https://toolset.com/forums/topic/gravity-forms-date-field-compatibility-issue/

However, the function doesn't seem to run at all. I've put in my forms unique ID, the correct slug and the field ID, but when I re-test submitting a form the date still gets stored as the YY/MM/DD gravity forms version, not the UNIX one. Is that code perhaps out of date with the new PHP update or something? I'm not sure what would cause it to not work, but i've tried just about every variation, using the child functions.php, the toolset code snippet, and multiple forms and even tried changing the slug and still no luck.

If there's some sort of update needed to the snippet any advice would be greatly appreciated, otherwise I'm not quite sure how to fix the formatting to stop the pages crashing.

#2612503

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Can you please show me how exactly you added the code shared with the following reference ticket you shared:
- https://toolset.com/forums/topic/gravity-forms-date-field-compatibility-issue/

In addition to that, please share admin access details and problem URL where I can see the gravity form added on the frontend.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

The topic ‘[Closed] Critical Error with php update’ is closed to new replies.