Skip Navigation

[Resolved] PHP 8.x errors in class-conditional-php (forms)

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

Last updated by ellesd 1 year, 4 months ago.

Assisted by: Minesh.

Author
Posts
#2632051

I am trying to: I am getting a fatal error since php 8 upgrade. I used a test environment where i deactivated all other plugins and took 22 theme but still got this error.

eError: array_map(): Argument #2 ($array) must be of type array, null given in /Users/pixelchick/Hosts/oesdatabase.test/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/classes/class.conditional.php:325 Stack trace: #0 /Users/pixelchick/Hosts/oesdatabase.test/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/classes/class.conditional.php(325): array_map('serialize', NULL) #1 /Users/pixelchick/Hosts/oesdatabase.test/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/classes/class.conditional.php(288): WPToolset_Forms_Conditional->array_unique_md(NULL) #2 /Users/pixelchick/Hosts/oesdatabase.test/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/classes/class.conditional.php(335): WPToolset_Forms_Conditional->_parseData() #3 /Users/pixelchick/Hosts/oesdatabase.test/wp-includes/class-wp-hook.php(310): WPToolset_Forms_Conditional->renderJsonData('') #4 /Users/pixelchick/Hosts/oesdatabase.test/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters(NULL, Array) #5 /Users/pixelchick/Hosts/oesdatabase.test/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #6 /Users/pixelchick/Hosts/oesdatabase.test/wp-admin/admin-footer.php(95): do_action('admin_print_foo...') #7 /Users/pixelchick/Hosts/oesdatabase.test/wp-admin/post.php(369): require_once('/Users/pixelchi...') #8 {main} thrown in /Users/pixelchick/Hosts/oesdatabase.test/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/classes/class.conditional.php on line 325

Link to a page where the issue can be seen:

I expected to see:

Instead, I got:

#2632361

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

Can you please share problem URL and access details and let me check whats going wrong with your setup.

*** 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.

#2632573

You can check at oesdatabase.eu. I cant give you access to a development server, but i can make an admin account to get access for the wp-admin. The problems started after upgrading to php 8. Please give me your email for user account.

#2632843

Minesh
Supporter

Languages: English (English )

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

If you cant able to give me access then it would be great if you can send me duplicator copy of your site as well as share details on what page/post I can see the issue and what form is involved?

Can you please send me duplicator copy of your site:
- https://toolset.com/faq/provide-supporters-copy-site/

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

#2632945

Hi Minesh trying to create a package from my website but the server got a timeout. Its too big. Can i send you all files and a database backup in a zip file?

#2633145

Error Details
=============
An error of type E_ERROR was caused in line 325 of the file /home/oesdata/domains/oesdatabase.eu/public_html/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/classes/class.conditional.php. Error message: Uncaught TypeError: array_map(): Argument #2 ($array) must be of type array, null given in /home/oesdata/domains/oesdatabase.eu/public_html/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/classes/class.conditional.php:325
Stack trace:
#0 /home/oesdata/domains/oesdatabase.eu/public_html/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/classes/class.conditional.php(325): array_map()
#1 /home/oesdata/domains/oesdatabase.eu/public_html/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/classes/class.conditional.php(288): WPToolset_Forms_Conditional->array_unique_md()
#2 /home/oesdata/domains/oesdatabase.eu/public_html/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/classes/class.conditional.php(335): WPToolset_Forms_Conditional->_parseData()
#3 /home/oesdata/domains/oesdatabase.eu/public_html/wp-includes/class-wp-hook.php(310): WPToolset_Forms_Conditional->renderJsonData()
#4 /home/oesdata/domains/oesdatabase.eu/public_html/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
#5 /home/oesdata/domains/oesdatabase.eu/public_html/wp-includes/plugin.php(517): WP_Hook->do_action()
#6 /home/oesdata/domains/oesdatabase.eu/public_html/wp-admin/admin-footer.php(95): do_action()
#7 /home/oesdata/domains/oesdatabase.eu/public_html/wp-admin/post.php(369): require_once('/home/oesdata/d...')
#8 {main}
thrown

#2633567

Minesh
Supporter

Languages: English (English )

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

Yes sure, please send me files and database and also please share problem URL on what post/page you added the form.

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

#2633759
Screenshot 2023-08-14 at 17.36.17.png
Screenshot 2023-08-14 at 18.00.55.png

I was testing yesterday. At the left you see a screenshot of my website oesdatabase.eu. As you see I still use the classic editor. But it breaks because of the Toolset error. At the left is another site with pretty much the same field groups. I have deactivated all plugins, only Toolset active and the error was still there. Also with the standard WP themes.

Here I uploaded the package with my database and all contents. I took the test environment because there I allready changed all paths to same url 'oesdatabase.test' (so not with www.)

wetransfer: hidden link

the other website is: karinbrandt.nl which works fine. (same hosting)

#2633975

Minesh
Supporter

Languages: English (English )

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

Can you please share information on what page I can see the issue?

With previous reply you shared, I can see the error is from Toolset forms plugin:
- https://toolset.com/forums/topic/php-8-x-errors-in-class-conditional-php-forms-2/#post-2633145

But when you shared screenshot from your previous reply:
- https://toolset.com/forums/topic/php-8-x-errors-in-class-conditional-php-forms-2/#post-2633759

I do not see the Toolset form is added on your classic editor.

Can you please share exact steps I will have to follow to see the issue.

#2633977

Hi Minesh, I get it immediately after editing the custom post type dog. But the screenshot was from a page. The visual editor is not probably loading neither. The message is not shown at the dashboard but after editing. This seems logical because than Toolset will be loaded too. I dont use views, but I show all field with PHP.

#2633979

Minesh
Supporter

Languages: English (English )

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

I'm asking again, Can you please share problem URL and exact steps I will have to follow to see the issue.

#2633981

ALL urls in the admin!
- I login and go to the post type dogs
- I add a new one or edit current and than get fatal error like I shared before.

At the custom post types I dont use the visual editor because it are all custom fields. I used to work with conditional fields too but I removed those to check if this causes the error.

I cant add content anymore to the visual editor of pages. The toolset error breaks the editor.

So go to the custom post type dogs and edit any post to see whats happening.
Is this clear for you to reproduce it?

#2635971

any updates or something i can do?

#2636015

Minesh
Supporter

Languages: English (English )

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

Ok I find that you have number of custom field groups added.
- hidden link

Now, you have number of custom field groups as well as custom fields set to display conditionally.

One of the example is, you can edit any of your Dog post for instance::
- hidden link

I can see that the output is broken when the custom field group "Section: Simpele cover" is displayed at bottom of the page and when I edit the custom field group:
- hidden link

I found that the field "Cover kleur opties" is set to display conditionally, as you can see with the following screenshot:
- hidden link

When I edit that condition I found multiple conditions added and those are broken conditions as well.

When I deleted the condition then on the edit Dog page:
- hidden link

I'm able to see the field "Cover kleur opties" which was not displayed when condition was there.

*** Please make a FULL BACKUP of your database and website.***

I see you have number of malformed conditions and I suggest you should try to remove most of the conditions from your custom field group and custom fields where you set your custom fields to display conditionally as well as custom field group that you set to display conditionally and try to add it one by one again to make sure you have right conditions added and conditions should not be malformed.

#2636085

Thanks Minesh, removed them there. They were hidden by the advanced editing. Its strange that it was broken because I made this years ago. Will check this on other parts of the website and let you know if its resolved than. Keep you updated and thanks for the suggestions this far.