Skip Navigation

[Closed] Intermittent Critical Error with Types

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

Last updated by Minesh 6 months, 2 weeks ago.

Assisted by: Minesh.

Author
Posts
#2707801

I am trying to: Use wordpress. Out of nowhere we'll get a critical error if we sit on it for a while (not always) The error goes away and we can use the site again. If we manually rename the types folder and then go into plugins to make sure it's disabled we can then name it back to its regular name and use the site again for a while without any problems. Toolset blocks was also enabled but we have now disabled it.

Link to a page where the issue can be seen: Any page, admin or front end - intermittent

I expected to see: Any page; not an error.

Instead, I got: There has been a critical error on this website. Please check your site admin email inbox for instructions.

Other backgrounder: This particular website install was in a multi site installation and has been migrated to a stand alone. We've performed these actions thousands of times over and never had a problem so it's a little confounding what's going on.

I turned on debugging and have received the following error details:

[15-Jul-2024 16:11:47 UTC] PHP Deprecated: Creation of dynamic property Toolset_Object_Relationship::$relations is deprecated in /nas/content/live/genex2024/wp-content/plugins/toolset-blocks/vendor/toolset/toolset-common/inc/toolset.object.relationship.class.php on line 18
[15-Jul-2024 16:11:47 UTC] PHP Deprecated: Creation of dynamic property Toolset_Object_Relationship::$post_relationship_depth is deprecated in /nas/content/live/genex2024/wp-content/plugins/toolset-blocks/vendor/toolset/toolset-common/inc/toolset.object.relationship.class.php on line 19
[15-Jul-2024 16:11:47 UTC] PHP Deprecated: Creation of dynamic property Toolset_Object_Relationship::$post_relationship_track is deprecated in /nas/content/live/genex2024/wp-content/plugins/toolset-blocks/vendor/toolset/toolset-common/inc/toolset.object.relationship.class.php on line 20
[15-Jul-2024 16:11:47 UTC] PHP Deprecated: Creation of dynamic property Toolset_Object_Relationship::$post_relationship is deprecated in /nas/content/live/genex2024/wp-content/plugins/toolset-blocks/vendor/toolset/toolset-common/inc/toolset.object.relationship.class.php on line 21
[15-Jul-2024 16:11:47 UTC] PHP Fatal error: Uncaught Error: Attempt to modify property "response" on bool in /nas/content/live/genex2024/wp-content/plugins/types/vendor/otgs/installer/includes/class-installer-theme.php:574
Stack trace:
#0 /nas/content/live/genex2024/wp-includes/class-wp-hook.php(326): Installer_Theme_Class->installer_theme_upgrade_check(false)
#1 /nas/content/live/genex2024/wp-includes/plugin.php(205): WP_Hook->apply_filters(false, Array)
#2 /nas/content/live/genex2024/wp-includes/option.php(2336): apply_filters('site_transient_...', false, 'update_themes')
#3 /nas/content/live/genex2024/wp-includes/update.php(913): get_site_transient('update_themes')
#4 /nas/content/live/genex2024/wp-admin/menu.php(33): wp_get_update_data()
#5 /nas/content/live/genex2024/wp-admin/admin.php(158): require('/nas/content/li...')
#6 /nas/content/live/genex2024/wp-admin/options-general.php(10): require_once('/nas/content/li...')
#7 {main}
thrown in /nas/content/live/genex2024/wp-content/plugins/types/vendor/otgs/installer/includes/class-installer-theme.php on line 574

#2707803

Just a heads up that this issue seems to happen with a function for a theme upgrade check called "installer_theme_upgrade_check". We've modified the code in the file "class-installer-theme.php" to include a check which seems to work so far:

/** Theme upgrade check */
public function installer_theme_upgrade_check( $the_value ) {

// Ensure $the_value is an object before proceeding
if ( !is_object( $the_value ) ) {
return $the_value;
}

// Step 1: Let's loop through repos with themes and check if we have updates available for them.
if ( is_array( $this->installer_repo_with_themes ) && !empty( $this->installer_repo_with_themes ) ) {
foreach ( $this->installer_repo_with_themes as $k => $repo_slug ) {
// Step 2: Let's check if we have an update for this theme
if ( is_array( $this->installer_themes_available_updates ) && isset( $this->installer_themes_available_updates[ $repo_slug ] ) ) {
$update_available = get_option( $this->installer_themes_available_updates[ $repo_slug ] );
} else {
$update_available = false;
}

if ( $update_available ) {
if ( is_array( $update_available ) ) {
// Has updates available coming from this specific theme repo
// Let's loop through the themes that need update
foreach ( $update_available as $theme_slug => $v ) {
// Add to response API
if ( property_exists( $the_value, 'response' ) ) {
$the_value->response[$theme_slug] = array(
'theme' => $theme_slug,
'new_version' => $v['new_version'],
'url' => $v['url'],
'package' => $v['package']
);
}
}
}
}
}
}

// Return
return $the_value;
}

As another note here, when we migrated the website we had a child theme using the old toolset starter theme from way back. Since we're building out a new theme for this site we've removed all the other themes that we no longer need to look at or use. I'm not sure if that has anything to do with anything but I thought I would mention that.

#2707921

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

Glad that you able to find the core cause of the issue and also able to fix it.

Can you please share details with what theme you have issue with and what exactly you modified in order to fix the issue. It seems you just added following lines of code:

// Ensure $the_value is an object before proceeding
if ( !is_object( $the_value ) ) {
return $the_value;
}

Also, can you please share exact steps in order to see the issue that will help use to report the issue in front of our Devs with all those required details.

The topic ‘[Closed] Intermittent Critical Error with Types’ is closed to new replies.