• Hi,

    I’m getting the following error in my WP Debug logs:

    PHP Fatal error:  Uncaught Error: Cannot use object of type WP_Error as array in /path/to/wp/wp-content/plugins/wp-help/classes/plugin.php:339
    Stack trace:
    #0 /path/to/wp/wp-includes/class-wp-hook.php(288): CWS_WP_Help_Plugin->api_slurp()
    #1 /path/to/wp/wp-includes/class-wp-hook.php(312): WP_Hook->apply_filters('', Array)
    #2 /path/to/wp/wp-includes/plugin.php(544): WP_Hook->do_action(Array)
    #3 /path/to/wp/wp-cron.php(138): do_action_ref_array('cws_wp_help_upd...', Array)
    #4 {main}
      thrown in /path/to/wp/wp-content/plugins/wp-help/classes/plugin.php on line 339

    I’m running WP 5.3 and WP Help 1.7.0.

    Any ideas?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Same, I have this error after update:

    Uncaught Error: Class ‘WP_Stack_Plugin2’ not found in /public_html/wp-content/plugins/wp-help/classes/plugin.php:4

    Thread Starter vickita

    (@vickita)

    Also seeing

    Trying to get property 'cap' of non-object in /path/to/wp/wp-content/plugins/wp-help/classes/plugin.php on line 211
    and
    Trying to get property 'read_posts' of non-object in /path/to/wp/wp-content/plugins/wp-help/classes/plugin.php on line 211

    • This reply was modified 5 years, 3 months ago by vickita.

    @vickita the notice you’re seeing should be hidden if you set WP_DEBUG to false, I was setting up some users to redirect on login, and I was seeing this too.

    I added this to fix:

    	    if( !is_object( self::POST_TYPE ) )
    	        return null;
    

    So the entire method reads thus:

    	protected function get_cap( $cap ) {
    	    if( !is_object( self::POST_TYPE ) )
    	        return null;
    		return get_post_type_object( self::POST_TYPE )->cap->{$cap};
    	}
    

    Hope this helps somebody. @markjaquith I’m sorry but SVN stumps me; otherwise I’d make submissions to help!

    • This reply was modified 5 years, 1 month ago by jcdesign.

    @vickita @markjaquith sorry, I was moving too quickly yesterday.

    It should be:

    
    	protected function get_cap( $cap ) {
    	    if( ! is_object( get_post_type_object( self::POST_TYPE ) ) )
    	        return null;
    		return get_post_type_object( self::POST_TYPE )->cap->{$cap};
    	}
    
    

    – Need to actually GET the post type object before checking if it’s an object!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Debug shows fatal error’ is closed to new replies.