• Resolved leggo-my-eggo

    (@leggo-my-eggo)


    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?

    https://www.ads-software.com/extend/plugins/post-types-order/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter leggo-my-eggo

    (@leggo-my-eggo)

    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”.

    Plugin Author nsp-code

    (@nsp-code)

    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 [email protected]

    Thread Starter leggo-my-eggo

    (@leggo-my-eggo)

    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.

    Thread Starter leggo-my-eggo

    (@leggo-my-eggo)

    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.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Illegal offset type in isset or empty’ is closed to new replies.