Skip Navigation

[Resolved] Saving a types form results in critical wordpress error

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/Karachi (GMT+05:00)

This topic contains 7 replies, has 3 voices.

Last updated by Waqar 1 year, 9 months ago.

Assisted by: Waqar.

Author
Posts
#2656105

Tell us what you are trying to do?
I have created a new CPT named 'Kundenprojekte' and generated an associated creation form. When I try to save the form, it results in a critical error. I have cleared the cache and checked if the CPT fields are correctly included in the form, but unfortunately, it didn't help.
Is there any documentation that you are following?

Is there a similar example that we can see?

What is the link to your site?
its locked only for users (hidden link)

#2656111

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Do you have details of the error, please?

If you haven't already, turn on the debug log by editing your wp-config.php file and change the line with WP_DEBUG like so:

define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
define('WP_DISABLE_FATAL_ERROR_HANDLER',true);

That will create a debug.log file in your /wp-content/ directory which you can examine in any text editor. Try re-saving the form that generates the error and then inspect the log.

Can you also confirm if the error occurs if you disable all plugins except for Types and Forms, and switch to a default theme such as twentytwentyone.

#2656145

Here is the debug but I still dont understand what causes the fatal error
[24-Oct-2023 06:55:21 UTC] PHP Fatal error: Uncaught TypeError: array_filter(): Argument #1 ($array) must be of type array, string given in /var/www/wp-content/plugins/cred-frontend-editor/application/controllers/validators/toolset_forms.php:101
Stack trace:
#0 /var/www/wp-content/plugins/cred-frontend-editor/application/controllers/validators/toolset_forms.php(101): array_filter('')
#1 /var/www/wp-content/plugins/cred-frontend-editor/application/controllers/validators/form.php(49): CRED_Validator_Toolset_Forms->validate()
#2 /var/www/wp-content/plugins/cred-frontend-editor/application/models/form/base.php(974): CRED_Validator_Form->validate()
#3 /var/www/wp-content/plugins/cred-frontend-editor/application/models/form/base.php(423): CRED_Form_Base->validate_form(NULL)
#4 /var/www/wp-content/plugins/cred-frontend-editor/application/controllers/form_builder_base.php(42): CRED_Form_Base->print_form()
#5 /var/www/wp-content/plugins/cred-frontend-editor/library/toolset/cred/embedded/classes/CRED_Helper.php(1799): CRED_Form_Builder_Base->get_form(82736, '')
#6 /var/www/wp-content/plugins/cred-frontend-editor/library/toolset/cred/embedded/classes/CRED_Helper.php(2398): CRED_Helper::cred_form('kundenprojekt-e...', '')
#7 /var/www/wp-includes/shortcodes.php(433): CRED_Helper::credFormShortcode(Array, '', 'cred-form')
#8 [internal function]: do_shortcode_tag(Array)
#9 /var/www/wp-includes/shortcodes.php(273): preg_replace_callback('/\\[(\\[?)(cred\\-...', 'do_shortcode_ta...', '\n\n\n<div class="...')
#10 /var/www/wp-includes/class-wp-hook.php(310): do_shortcode('\n\n\n<div class="...')
#11 /var/www/wp-includes/plugin.php(205): WP_Hook->apply_filters('\n\n\n<div class="...', Array)
#12 /var/www/wp-includes/post-template.php(256): apply_filters('the_content', '<!-- wp:html /-...')
#13 /var/www/wp-content/themes/Divi/page.php(46): the_content()
#14 /var/www/wp-includes/template-loader.php(106): include('/var/www/wp-con...')
#15 /var/www/wp-blog-header.php(19): require_once('/var/www/wp-inc...')
#16 /var/www/index.php(17): require('/var/www/wp-blo...')
#17 {main}
thrown in /var/www/wp-content/plugins/cred-frontend-editor/application/controllers/validators/toolset_forms.php on line 101
[24-Oct-2023 06:56:23 UTC] PHP Fatal error: Uncaught TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, non-static method WP24_Domain_Check_Settings::uninstall() cannot be called statically in /var/www/wp-includes/class-wp-hook.php:310
Stack trace:
#0 /var/www/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters('', Array)
#1 /var/www/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#2 /var/www/wp-admin/includes/plugin.php(1269): do_action('uninstall_wp24-...')
#3 /var/www/wp-admin/includes/plugin.php(960): uninstall_plugin('wp24-domain-che...')
#4 /var/www/wp-admin/includes/ajax-actions.php(4748): delete_plugins(Array)
#5 /var/www/wp-includes/class-wp-hook.php(310): wp_ajax_delete_plugin('')
#6 /var/www/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters('', Array)
#7 /var/www/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#8 /var/www/wp-admin/admin-ajax.php(188): do_action('wp_ajax_delete-...')
#9 {main}
thrown in /var/www/wp-includes/class-wp-hook.php on line 310
[24-Oct-2023 06:56:36 UTC] PHP Warning: Undefined array key "comment" in /var/www/wp-content/plugins/woocommerce/src/Internal/Admin/Translations.php on line 84
[24-Oct-2023 06:56:36 UTC] PHP Warning: Trying to access array offset on value of type null in /var/www/wp-content/plugins/woocommerce/src/Internal/Admin/Translations.php on line 84
[24-Oct-2023 06:56:56 UTC] PHP Fatal error: Uncaught TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, non-static method WP24_Domain_Check_Settings::uninstall() cannot be called statically in /var/www/wp-includes/class-wp-hook.php:310
Stack trace:
#0 /var/www/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters('', Array)
#1 /var/www/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#2 /var/www/wp-admin/includes/plugin.php(1269): do_action('uninstall_wp24-...')
#3 /var/www/wp-admin/includes/plugin.php(960): uninstall_plugin('wp24-domain-che...')
#4 /var/www/wp-admin/includes/ajax-actions.php(4748): delete_plugins(Array)
#5 /var/www/wp-includes/class-wp-hook.php(310): wp_ajax_delete_plugin('')
#6 /var/www/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters('', Array)
#7 /var/www/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#8 /var/www/wp-admin/admin-ajax.php(188): do_action('wp_ajax_delete-...')
#9 {main}
thrown in /var/www/wp-includes/class-wp-hook.php on line 310
[24-Oct-2023 06:57:31 UTC] PHP Deprecated: Required parameter $render_slug follows optional parameter $content in /var/www/wp-content/plugins/toolset-blocks/vendor/toolset/divi/includes/modules/View/View.php on line 56
[24-Oct-2023 06:57:44 UTC] PHP Fatal error: Uncaught TypeError: array_filter(): Argument #1 ($array) must be of type array, string given in /var/www/wp-content/plugins/cred-frontend-editor/application/controllers/validators/toolset_forms.php:101
Stack trace:
#0 /var/www/wp-content/plugins/cred-frontend-editor/application/controllers/validators/toolset_forms.php(101): array_filter('')
#1 /var/www/wp-content/plugins/cred-frontend-editor/application/controllers/validators/form.php(49): CRED_Validator_Toolset_Forms->validate()
#2 /var/www/wp-content/plugins/cred-frontend-editor/application/models/form/base.php(974): CRED_Validator_Form->validate()
#3 /var/www/wp-content/plugins/cred-frontend-editor/application/models/form/base.php(423): CRED_Form_Base->validate_form(NULL)
#4 /var/www/wp-content/plugins/cred-frontend-editor/application/controllers/form_builder_base.php(42): CRED_Form_Base->print_form()
#5 /var/www/wp-content/plugins/cred-frontend-editor/library/toolset/cred/embedded/classes/CRED_Helper.php(1799): CRED_Form_Builder_Base->get_form(82736, '')
#6 /var/www/wp-content/plugins/cred-frontend-editor/library/toolset/cred/embedded/classes/CRED_Helper.php(2398): CRED_Helper::cred_form('kundenprojekt-e...', '')
#7 /var/www/wp-includes/shortcodes.php(433): CRED_Helper::credFormShortcode(Array, '', 'cred-form')
#8 [internal function]: do_shortcode_tag(Array)
#9 /var/www/wp-includes/shortcodes.php(273): preg_replace_callback('/\\[(\\[?)(cred\\-...', 'do_shortcode_ta...', '\n\n\n<div class="...')
#10 /var/www/wp-includes/class-wp-hook.php(310): do_shortcode('\n\n\n<div class="...')
#11 /var/www/wp-includes/plugin.php(205): WP_Hook->apply_filters('\n\n\n<div class="...', Array)
#12 /var/www/wp-includes/post-template.php(256): apply_filters('the_content', '<!-- wp:html /-...')
#13 /var/www/wp-content/themes/Divi/page.php(46): the_content()
#14 /var/www/wp-includes/template-loader.php(106): include('/var/www/wp-con...')
#15 /var/www/wp-blog-header.php(19): require_once('/var/www/wp-inc...')
#16 /var/www/index.php(17): require('/var/www/wp-blo...')
#17 {main}
thrown in /var/www/wp-content/plugins/cred-frontend-editor/application/controllers/validators/toolset_forms.php on line 101

#2656165

I also deactivated all plugins like you said, but the error still ocured.

#2656381

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

OK, thanks for that.

You say the error occurs when trying to save the form?

Looking at the call stack of the error, I have the impression it relates to displaying a page made with Divi, that I expect includes the form, but that's not what you describe.

Would it be possible to get credentials from you to access the back end of the site and inspect your set up?

Let me mark your next reply as private so that we can get log-in credentials from you—you may want to create a temporary admin user for us to use that you can later delete. And be sure to have a current backup of your site.

Can you also confirm, have you inserted the form into a page? Which page?

#2656823

Thank you for sharing the access details.

While I didn't have any issue saving the form in the admin area, I noticed that it was struck with the AJAX error, when I submitted it from the frontend.

Do I have your permission to download a clone/snapshot of the website? This will help in troubleshooting this on a different server, without affecting the actual website.

#2656853

Of course, I allow you to clone the website. However, I cannot grant you FTP access. The system already has AIO Migration installed, which you are welcome to use.

#2657683

Thank you for sharing the access details.

During troubleshooting on your website's clone, I noticed that the issue with the form is fixed if PHP is switched to PHP 7.

The form itself is complex with many fields and conditional groups. With PHP 8, the form fails because there are fields where the long text values are saved as options-based fields like select, radio, and checkboxes. This long text value not only includes special characters like ',' and spaces but they are also used in the conditional groups for conditional display.
( screenshot: hidden link )

For an immediate fix, you can switch the server's PHP version to PHP 7+. For a proper long-term fix, you can redo the option-based custom fields, so that the value part doesn't include long text values or special characters. For the display text, you can use any text, but for the values or custom field content of those options, it is most efficient and safe to use numeric values (e.g. 1, 2, 3 ... )