Skip Navigation

[Resolved] Fatal error when I try to edit pages + posts in backend

This support ticket is created 3 years, 1 month 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
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 14 replies, has 2 voices.

Last updated by uweA 3 years, 1 month ago.

Assisted by: Shane.

Author
Posts
#2320631

I am trying to: edit existing posts + pages or create new posts + pages

Link to a page where the issue can be seen: Only in Backend

I expected to see: Editor of pages + Posts

Instead, I got: a fatal error

I am using WordPress 5.9.2, Sydney Theme 1.76, all Plugins are updated esp. Toolset + Yoast SEO

Best Regards
Uwe Ahlgrimm

PS: I couldn't submit the PHP-error code.

#2320735

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Uwe,

Thank you for getting in touch.

Without the error log i'm not able to say what the issue is. Are you able to take a screenshot of the error output so that I can see what the error is.

If you're not able to see the error itself then I recommend following the instructions in the link below to dump the error onto the page.

To enable the wordpress debugging you will either need to log into your website using FTP or using your Host's CPanel's file manager.

From there you will need to edit the wp-config file by adding the following.

// Enable WP_DEBUG mode
define( 'WP_DEBUG', true );

// Enable Debug logging to the /wp-content/debug.log file
define( 'WP_DEBUG_LOG', true );

If the define( 'WP_DEBUG', true ); function already exists you will need to change 'false' to 'true'

Once you've done this please revisit the page with the issue and let me know what the issue is.

Thanks,
Shane

#2320779
error2-2.jpg
error2-1.jpg
error1.jpg

Hi Shane,
OK!
When I try to open /wp-admin/post.php?post=11&action=edit&classic-editor, I get error1.jpg
And when I try /wp-admin/post-new.php?post_type=page, I get error2-1.jpg + error2-2.jpg (A longer list).
Btw: the server uses PHP 7.4.28 ...

The PHP-errors on frontend are:
Notice: Uninitialized string offset: 0 in /var/www/vhosts/do-xs.de/httpdocs/doxs/wp-content/themes/sydney/inc/styles.php on line 9
Notice: Uninitialized string offset: 0 in /var/www/vhosts/do-xs.de/httpdocs/doxs/wp-content/themes/sydney/inc/styles.php on line 12
Notice: Uninitialized string offset: 1 in /var/www/vhosts/do-xs.de/httpdocs/doxs/wp-content/themes/sydney/inc/styles.php on line 12
Notice: Uninitialized string offset: 2 in /var/www/vhosts/do-xs.de/httpdocs/doxs/wp-content/themes/sydney/inc/styles.php on line 12
Notice: Uninitialized string offset: 3 in /var/www/vhosts/do-xs.de/httpdocs/doxs/wp-content/themes/sydney/inc/styles.php on line 12
Notice: Uninitialized string offset: 4 in /var/www/vhosts/do-xs.de/httpdocs/doxs/wp-content/themes/sydney/inc/styles.php on line 12
Notice: Uninitialized string offset: 5 in /var/www/vhosts/do-xs.de/httpdocs/doxs/wp-content/themes/sydney/inc/styles.php on line 12
Notice: Uninitialized string offset: 0 in /var/www/vhosts/do-xs.de/httpdocs/doxs/wp-content/themes/sydney/inc/styles.php on line 9
Notice: Uninitialized string offset: 0 in /var/www/vhosts/do-xs.de/httpdocs/doxs/wp-content/themes/sydney/inc/styles.php on line 12
Notice: Uninitialized string offset: 1 in /var/www/vhosts/do-xs.de/httpdocs/doxs/wp-content/themes/sydney/inc/styles.php on line 12
Notice: Uninitialized string offset: 2 in /var/www/vhosts/do-xs.de/httpdocs/doxs/wp-content/themes/sydney/inc/styles.php on line 12
Notice: Uninitialized string offset: 3 in /var/www/vhosts/do-xs.de/httpdocs/doxs/wp-content/themes/sydney/inc/styles.php on line 12
Notice: Uninitialized string offset: 4 in /var/www/vhosts/do-xs.de/httpdocs/doxs/wp-content/themes/sydney/inc/styles.php on line 12
Notice: Uninitialized string offset: 5 in /var/www/vhosts/do-xs.de/httpdocs/doxs/wp-content/themes/sydney/inc/styles.php on line 12

Forgot to mention: When I deactivate Yoast SEO-Plugin I can open pages + posts, but I can't create new ones...
And I can't create new users! Very strange, very strange...

Best regards
Uwe

#2320817

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Uwe,

Can you provide me with both admin and FTP access to the website so that I can have a more detailed look at what is happening here?

Thanks.
Shane

#2320929

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Uwe,

I took at the debug data for your site and saw that you were running mysql version 5.5.5 .Unfortunately our Toolset plugins require at least version 5.6

Here below you can see the minimum server requirements that are required for our Toolset plugins to function correctly.
https://toolset.com/toolset-requirements/

Once you can ensure that your server meets these minimum requirements please let me know if the issue still remains.
Thanks,
Shane

#2321879

Hi Shane,
before I migrated this site to a new server/provider, it used MySQL 5.7 and everything was fine. On the new server I don't have MySQL but 10.1.48-MariaDB-0ubuntu0.18.04.1. I think this version is compatible to MySQL... what do you think?

Best regards
Uwe

#2322997

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Uwe,

Yes this should be compatible. What I would like to do is grab a copy of your website to see if the same issue persists on my end.

This will help me to be able to check if the problem is server related or not.

Let me know if this is ok with you.

Thanks,
Shane

#2323189

Hi Shane,
thats ok for me. Do you need anything?

best regards
Uwe

#2323365

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Uwe,

I created a copy of the site but i'm not getting the errors described in your thread on the copy or even yet on your actual site.

Can you layout a detailed step for me to follow to replicate the issue.

Thanks,
Shane

#2323781

Hi Shane,
with all the plugins activated, I can edit existing posts + pages, but I can't create new ones. When I try, I get the error-massages you read in the screenshots. BTW: I can't create new users too.
Yesterday I deactivated Toolset and after trying to create a new post I get:
„Warning: Creating default object from empty value in /var/www/vhosts/do-xs.de/httpdocs/doxs/wp-admin/includes/post.php on line 742“
This domain and the site is since 2 weeks on this server, on the old server of another provider everything worked fine.
On this new server is another wordpress installation with a MariaDB and I see no problems.

I contacted the new provider and he suspects an error of wordpress...

Best regards
Uwe

#2324021

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Uwe,

I was able to replicate the issue locally here.

I see the issue is being cause by your custom field group. The problem is that your field groups are assigned to custom post types that no longer exists.

If you go to Toolset -> Custom Field you will see that one group is assigned to Movies and another to Program Points but none of these 2 post types exist when you go to Toolset -> Post Types.

Disabling the custom field groups restore the functionality of the site.

Thanks,
Shane

#2324089

Hi Shane,
yes - I deleted the group, but this has no effect on the errors.

Creating a new post /wp-admin/post-new.php:

Warning: Creating default object from empty value in /var/www/vhosts/do-xs.de/httpdocs/doxs/wp-admin/includes/post.php on line 742
Fatal error: Uncaught InvalidArgumentException: Invalid argument type for the post type. in /var/www/vhosts/do-xs.de/httpdocs/doxs/wp-content/plugins/types/vendor/toolset/toolset-common/inc/autoloaded/field/group.php:537 Stack trace: #0 /var/www/vhosts/do-xs.de/httpdocs/doxs/wp-content/plugins/types/vendor/toolset/toolset-common/inc/autoloaded/field/group/post_factory.php(310): Toolset_Field_Group->is_assigned_to_type() #1 /var/www/vhosts/do-xs.de/httpdocs/doxs/wp-content/plugins/types/vendor/toolset/toolset-common/inc/autoloaded/field/group/post_factory.php(256): Toolset_Field_Group_Post_Factory::{closure}() #2 /var/www/vhosts/do-xs.de/httpdocs/doxs/wp-content/plugins/types/vendor/toolset/toolset-common/inc/autoloaded/field/group/post_factory.php(480): Toolset_Field_Group_Post_Factory->filter_groups() #3 /var/www/vhosts/do-xs.de/httpdocs/doxs/wp-content/plugins/types/vendor/toolset/types/embedded/includes/fields-post.php(1489): Toolset_Field_Group_Post_Factory->get_groups_for_element() #4 /var/www/vhosts/do-xs.de/httpdoc in /var/www/vhosts/do-xs.de/httpdocs/doxs/wp-content/plugins/types/vendor/toolset/toolset-common/inc/autoloaded/field/group.php on line 537

I am working with a copy of the site on my own webspace and it's the same...

Best regards
Uwe

#2324237

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Uwe,

I believe there might be some corruption in the sites database as i'm not being allowed to create a field group and if I do its created without an ID.

If possible I would recommend backing up the data only for this site and reinstalling wordpress itself then reinstalling all your plugins.

You can do this and rebuild the site from the ground up, however if you have a backup of the site without this issue then you can go ahead and restore it.

Thanks,
Shane

#2324729

Hi Shane,
yes, I think the problem is the db-migration from MySQl 5.7 to MariaDB 10! I will test that on my demo-site. I contacted the provider - they have some webdevelopers who will help me...

Thanks
Uwe

#2324731

My issue is resolved now. Thank you!