Skip Navigation

[Resolved] Fatal Error on site due to Toolset Blocks in PHP 8.0

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

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

Last updated by manakM 2 years, 7 months ago.

Assisted by: Minesh.

Author
Posts
#2407607

I am unable to set my site to PHP 8.0 because toolset blocks keeps throwing up a critical error making the backend inaccessible.

"WordPress caught an error with one of your plugins, Toolset Blocks.

An error of type E_ERROR was caused in line 171 of the file /home3/**********/*****************/wp-content/plugins/toolset-blocks/inc/wpv-plugin.class.php. Error message: Uncaught TypeError: array_search(): Argument #2 ($haystack) must be of type array, null given in /home3/*********/*****************/wp-content/plugins/toolset-blocks/inc/wpv-plugin.class.php:171"

WordPress version 6.0
Active theme: Astra Child (version 1.0.0)
Current plugin: Toolset Blocks (version 1.6.3)
PHP version 8.0.18

I've changed the PHP version back to 7.4 temporarily until we are able to figure out the reason for the error.

#2407615

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

The latest Toolset plugins are already PHP 8 compatible. Please check the following blog post:
- https://toolset.com/2022/05/toolset-1-6-3-full-compatibility-with-php-8/

I see you are using latest Toolset plugins and its strange that you could not able to switch to PHP 8.

what if you create a staging site that you should setup with PHP 8 and send me the admin and FTP access details for the same.

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

#2407617
#2407663

Minesh
Supporter

Languages: English (English )

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

I've renamed the Toolset Block's folder within the plugins folder.

And When I try to login to wp-admin on the staging site you shared, I get the following fatal error:

Fatal error: Uncaught TypeError: array_flip(): Argument #1 ($array) must be of type array, null given in /home3/syanfmsu/staging.theypfoundation.org/wp-admin/includes/menu.php:294 Stack trace: #0 /home3/syanfmsu/staging.theypfoundation.org/wp-admin/includes/menu.php(294): array_flip(NULL) #1 /home3/syanfmsu/staging.theypfoundation.org/wp-admin/menu.php(394): require_once('/home3/syanfmsu...') #2 /home3/syanfmsu/staging.theypfoundation.org/wp-admin/admin.php(158): require('/home3/syanfmsu...') #3 /home3/syanfmsu/staging.theypfoundation.org/wp-admin/index.php(10): require_once('/home3/syanfmsu...') #4 {main} thrown in /home3/syanfmsu/staging.theypfoundation.org/wp-admin/includes/menu.php on line 294

Update:
Also, would you mind to test the issue with only Toolset plugins active and default twentytwentytwo theme?

Could you please address this first?

#2407713

Hi, I found the issue after digging through the WordPress documentation regarding the array_flip() error. I had written a custom plugin to rearrange the WordPress admin menu which was causing the error. I don't know why the email I received about the critical error said that the issue was with the toolset blocks plugin. Everything works fine after I deactivated the custom coded plugin.

Thanks for the help in troubleshooting this Minesh.

Warm regards,
Rithvik