Home › Toolset Professional Support › [Resolved] Website crashes when using php version 8
Problem:
Upon updating PHP to version 8, Toolset Types and Layouts cause a site crash, generating fatal errors like: "Uncaught TypeError: Cannot access offset of type string on string."
Solution:
Identified database corruptions causing errors in loading Layouts. To resolve, delete specific options from the options table:
- ddl_template_option
- ddl_layouts_css_framework_options
- users_options_private.
This can be done via phpMyAdmin.
Make sure you have a backup before following the steps above.
0% of people find this useful.
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.
This topic contains 14 replies, has 3 voices.
Last updated by Christopher Amirian 1 year, 1 month ago.
Assisted by: Christopher Amirian.
When i update my version of php to 8, toolset types and layouts generate a crash in my site. This are some errors that the site was giving:
[13-Nov-2023 14:43:48 UTC] PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /var/www/wp-content/plugins/layouts/classes-auto/wpddl.optionsmanager.class.php:114
Stack trace:
#0 /var/www/wp-content/plugins/layouts/classes-auto/wpddl.layouts-templates-settings.class.php(207): WPDDL_Options_Manager->update_options('ddl-template-de...', 'The content of ...', true)
#1 /var/www/wp-content/plugins/layouts/classes-auto/wpddl.layouts-templates-settings.class.php(188): WPDDL_Templates_Settings->set_option_value('ddl-template-de...', 'The content of ...')
#2 /var/www/wp-content/plugins/layouts/classes-auto/wpddl.layouts-templates-settings.class.php(26): WPDDL_Templates_Settings->set_default_message_default()
#3 /var/www/wp-content/plugins/layouts/classes-auto/wpddl.layouts-templates-settings.class.php(20): WPDDL_Templates_Settings->init()
#4 /var/www/wp-content/plugins/layouts/classes-auto/wpddl.layouts-templates-settings.class.php(134): WPDDL_Templates_Settings->__construct()
#5 /var/www/wp-includes/class-wp-hook.php(310): WPDDL_Templates_Settings::getInstance('')
#6 /var/www/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters(NULL, Array)
#7 /var/www/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#8 /var/www/wp-content/plugins/layouts/classes/wpddl.class.php(37): do_action('ddl-before_init...')
#9 /var/www/wp-content/plugins/layouts/classes/wpddl.class.php(304): WPDD_Layouts->__construct()
#10 /var/www/wp-content/plugins/layouts/classes-auto/wpddl.layouts-plugin.class.php(68): WPDD_Layouts::getInstance()
#11 /var/www/wp-includes/class-wp-hook.php(310): WPDD_LayoutsPlugin->init_layouts_plugin('')
#12 /var/www/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters(NULL, Array)
#13 /var/www/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#14 /var/www/wp-settings.php(610): do_action('after_setup_the...')
#15 /var/www/wp-config.php(97): require_once('/var/www/wp-set...')
#16 /var/www/wp-load.php(50): require_once('/var/www/wp-con...')
#17 /var/www/wp-admin/admin.php(34): require_once('/var/www/wp-loa...')
#18 /var/www/wp-admin/index.php(10): require_once('/var/www/wp-adm...')
#19 {main}
thrown in /var/www/wp-content/plugins/layouts/classes-auto/wpddl.optionsmanager.class.php on line 114
[13-Nov-2023 14:45:28 UTC] PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /var/www/wp-content/plugins/types/vendor/toolset/types/wpcf.php:405
Stack trace:
#0 /var/www/wp-includes/class-wp-hook.php(310): wpcf_upgrade_stored_taxonomies_with_builtin('')
#1 /var/www/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters(NULL, Array)
#2 /var/www/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#3 /var/www/wp-settings.php(632): do_action('init')
#4 /var/www/wp-config.php(97): require_once('/var/www/wp-set...')
#5 /var/www/wp-load.php(50): require_once('/var/www/wp-con...')
#6 /var/www/wp-admin/admin.php(34): require_once('/var/www/wp-loa...')
#7 /var/www/wp-admin/index.php(10): require_once('/var/www/wp-adm...')
#8 {main}
thrown in /var/www/wp-content/plugins/types/vendor/toolset/types/wpcf.php on line 405
Now the site is under php 7.4 and works but links to "propiedades" (a custom post type) doesn't work, for example this: hidden link
Languages: English (English ) Spanish (Español )
Timezone: Europe/London (GMT+00:00)
Hi there
Can you clarify which version of PHP you were upgrading to.
Toolset has been tested to version 8.1, but any problems with version 8.2+ are being handled as they are reported.
To check the problem with the links to the propiedad posts could we get access to your site?
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.
We can take a copy of the site at the same time to test the PHP version errors.
Hi there,
Thank you for the login information. Do we have permission to copy your website to our server?
Also, I wonder if the error shows right after the the activation of the plugin or I need to go to a specific page?
Thanks.
Hi Christopher,
Yes, you have permission to make a copy of the site.
The wordpress crash happens when you activate all toolset plugins and php is running on version 8.0 or 8.1. It displays at the frontend and the wordpress admin.
The 404 error happens now with all toolset plugins activated and php on version 7.4. To see this you can go here: hidden link
Hi there,
Thank you, we will start the copy process and get back to you.
For the second issue would you please open up a new ticket? I would split this ticket to have a separate ticket for the 404 issue but as I am off the next two days, I think a new ticket will get a faster reply.
Thanks.
Hi Christopher,
Ok, i'll wait for your reply on the php version issue.
On the 404 issue, it's solved now, i found the solution on another ticket.
Thanks!
Hi there,
Just to inform you I tried once to copy the website and it failed. But I tried it again and waiting for the process to finish.
Thank you.
Hi there,
The site is copied and the Tyes issue is fixed by doing as follows:
1. From WP Admin -> Toolset -> Taxonomies, open the edit screens of both the built-in taxonomies (Category & Tags) and use the 'Save Taxonomy' button.
( you don't have to make any changes)
Now I am checking to see if there is something can be done for the layouts plugins.
Thanks.
I could not find a clue regarding the layout plugin and I escalated the issue to the second tier support.
I will update you as soon as I have news.
Thanks.
Hi there,
I have an answer from the second tier for the layout issue:
In this case I found there were some corruptions in the database that provoke the errors that prevent Layouts from loading. I don't know anything about the history of the site to be able to say where the corruptions came from.
The 3 options with the option names below need deleting from the options table:
ddl_template_option ddl_layouts_css_framework_options users_options_privateThat is simple enough to do via phpMyAdmin (or using an Adminer plugin), but if u aren't oycomfortable doing that you can use a PHP code snippet instead:
delete_option( 'ddl_template_option' ); delete_option( 'ddl_layouts_css_framework_options' ); delete_option( 'users_options_private' );(With Types you can add a snippet at Toolset > Settings > Custom Code which you don't activate, but run one time only.)
Thanks.
Hi Christopher, thanks for your time and help.
I tryied the types and layouts solution on my dev site (the one I provided credentials in a previous answer). For the layouts solution, I couldn't find those options on the database via phpmyadmin, so I ran the code you provided via snippet. Unfortunatelly, when I change the php version to 8.0 or 8.1, the crash happens again. I disabble the layouts plugin and the site works under php 8, so the problem seems to be with that plugin (the types issue is resolved). Could you check the snippet to see if I'm doing it right?
Hi there,
Thanks. Checking with the second-tier support and will get back to you.
Thanks.
Hi there,
I have an answer. It seems that the Layout plugin is corrupt on your installation.
- IMPORTANT STEP! Create a backup of your website. Or better approach will be to test this on a copy/staging version of the website to avoid any disruption of a live website.
- Delete the Layouts plugin.
- Go to https://toolset.com/account/downloads/ and click the "Download Toolset manually " link at the bottom of the screen.
- Scroll down to find the Toolset Layouts plugin.
- Download it and install it on your website.
- Make sure everything is still working ok Layout wise.
- Change the PHP version to 8.
Thanks.
Hi Christopher, thanks for your answer.
I tried that solution in my staging site but unfortunately it didn't work. But I realized that if I deactivate the layouts plugin, the site works well under php 8.0, the pages are not broken, I can see the properties detail and everything seems to work fine. So my question is: can I use the types, maps and views plugins without using layouts? Or that could be a problem in the future?
Hi there,
Yes you can. The layouts plugin is a legacy plugin which as used to create layouts for the views. But if you use the Gutenberg blocks for the view or use the views from Toolset > Views menu, you do not need the layouts plugin.
If you used the Layouts plugin to create some layouts on your website then you will need to recreate them with Toolset Ciews.
Thanks.