WordPress.org

Ready to get started?Download WordPress

Forums

Post Types Order
[resolved] Illegal offset type in isset or empty (5 posts)

  1. leggo-my-eggo
    Member
    Posted 1 year ago #

    I'm using the advanced version of the plugin, and I'm getting a lot of errors like:

    Illegal offset type in isset or empty

    New Relic shows a stack trace of the error like this:

    …/wp-includes/post.php (1097)
    …/wp-content/plugins/advanced-post-types-order/include/functions.php (143)
    …/wp-content/plugins/advanced-post-types-order/advanced-post-types-order.php (127)
      in CPTOrderPosts called at ? (?)
    …/wp-includes/plugin.php (230)
    …/wp-includes/query.php (2588)
    …/wp-includes/query.php (2972)
    …/wp-includes/query.php (3059)
    …/wp-content/themes/mytheme/myfunctions/widgets.php (296)
    …/wp-includes/widgets.php (182)
      in WP_Widget::display_callback called at ? (?)
    …/wp-includes/widgets.php (893)
    …/wp-content/themes/mytheme/sidebar.php (11)
    …/wp-includes/template.php (407)
    …/wp-includes/template.php (383)
    …/wp-includes/general-template.php (92)
    …/wp-content/themes/mytheme/single-artist.php (30)
    …/wp-includes/template-loader.php (47)
    …/wp-blog-header.php (16)
    …/index.php (17)

    Any idea what's going on here?

    http://wordpress.org/extend/plugins/post-types-order/

  2. leggo-my-eggo
    Member
    Posted 1 year ago #

    Oh, and lines 294-296 in widgets.php is as follows:

    if ( 'artist' !== get_post_type() ) return;
    
    		$connected_documents = new WP_Query( array(
    		  'connected_type' => 'artist_to_document',
    		  'connected_items' => get_queried_object(),
    		  'nopaging' => true,
    		  'orderby' => 'menu_order',
    		  'order' => 'ASC'
    		) );

    Which is a query to pull a Posts 2 Posts connection for my custom post type, "artist".

  3. nsp-code
    Member
    Plugin Author

    Posted 1 year ago #

    There must be something wrong on your server as i see lot's of warnings in the WordPress core files including your theme.
    We can check that for your part of our plugin help assistance, please contact us at electronice_delphi@yahoo.com

  4. leggo-my-eggo
    Member
    Posted 1 year ago #

    I think you've misunderstood the stack trace. Those are not all errors. The error was thrown twice, once in /wp-includes/widgets.php and once in /wp-content/plugins/advanced-post-types-order/advanced-post-types-order.php. I'll email for help, thank you.

  5. leggo-my-eggo
    Member
    Posted 1 year ago #

    After some investigation, I've determined that advanced-post-types-order is not aware of post_type values as arrays. The Posts 2 Posts plugin sometimes passes these as arrays, and the WordPress spec allows for arrays. In my case, simply adding a 'post_type' => 'document' to my query in my widgets.php file has fixed the problem.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.