Skip Navigation

[Resolved] Urgent: Error Message in the Backend

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

This topic contains 1 reply, has 2 voices.

Last updated by Beda 6 years, 8 months ago.

Author
Posts
#625272

I am try to edit existing posts. It worked fine over the last weeks.

After deleting a Layout, which I don`t need anymore, I can`t actually edit any old Post anymore. Online the ones I overworked already.

This Project is not published yet and after updating all posts, pages and archives it will be the new relaunch of an existing project hidden link

For you I brought it out of the maintenance status, but the problem is in the Backend only.

The error message:

Catchable fatal error: Object of class __PHP_Incomplete_Class could not be converted to string in /var/www/web178/html/netzruferblog2018/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/classes/class.types.php on line 540

Any urgent help or advice for me?

Jörg

#625325

The only occurrence of a `__PHP_Incomplete_Class` is in WordPress itself, and it's firing when the object is not complete.
Prepares response data to be serialized to JSON.

/**
 * Prepares response data to be serialized to JSON.
 *
 * This supports the JsonSerializable interface for PHP 5.2-5.3 as well.
 *
 * @ignore
 * @since 4.4.0
 * @access private
 *
 * @param mixed $data Native representation.
 * @return bool|int|float|null|string|array Data ready for `json_encode()`.
 */
function _wp_json_prepare_data( $data ) {
	if ( ! defined( 'WP_JSON_SERIALIZE_COMPATIBLE' ) || WP_JSON_SERIALIZE_COMPATIBLE === false ) {
		return $data;
	}

	switch ( gettype( $data ) ) {
		case 'boolean':
		case 'integer':
		case 'double':
		case 'string':
		case 'NULL':
			// These values can be passed through.
			return $data;

		case 'array':
			// Arrays must be mapped in case they also return objects.
			return array_map( '_wp_json_prepare_data', $data );

		case 'object':
			// If this is an incomplete object (__PHP_Incomplete_Class), bail.
			if ( ! is_object( $data ) ) {
				return null;
			}

			if ( $data instanceof JsonSerializable ) {
				$data = $data->jsonSerialize();
			} else {
				$data = get_object_vars( $data );
			}

			// Now, pass the array (or whatever was returned from jsonSerialize through).
			return _wp_json_prepare_data( $data );

		default:
			return null;
	}
}

Now, in Types, where this error seems to happen, the function registered is used later in User and Post Field conditionals.

Can it be that some of your Fields are displaying conditionally in Toolset > Post Fields?
It seems the issue comes from there, although I cannot replicate anything similar locally.

Maybe you can add a duplicator package with the correct steps how we can replicate the issue?
https://toolset.com/faq/provide-supporters-copy-site/

Please first as well try a simple re-install (via FTP) of our Plugins.
This will not destroy any data, but I still recommend a backup.

Also, make sure WordPress core files are in the expected state (under Dashboard > Updates you can re-install as well).