The MU forums have moved to WordPress.org

Wp-Admin/Includes/Post.php Problem (2 posts)

  1. hhuskies
    Member
    Posted 16 years ago #

    Here are the warnings I am getting every time a user posts a new post on their blog. Please not though that the post DOES get inserted with proper settings, its just that these warnings pop up. How else can you turn off just warnings, by the way? Following are the errors:

    Warning: Invalid argument supplied for foreach() in /public_html/blogs/wp-admin/includes/post.php on line 206

    Warning: array_search() [function.array-search]: Wrong datatype for second argument in /public_html/blogs/wp-admin/includes/post.php on line 298

    Warning: Illegal string offset: -1200339554 in /public_html/blogs/wp-admin/includes/post.php on line 305

    Warning: Cannot modify header information - headers already sent by (output started at /public_html/blogs/wp-admin/includes/post.php:206) in /public_html/blogs/wp-includes/pluggable.php on line 440

    This is what is on each line in the post.php file:

    Line 206
    foreach ( $draft_ids as $temp => $real )

    Line 298
    if ( $draft_temp_id = (int) array_search( $post_ID, $draft_ids ) )

    Line 305
    $draft_ids[$temp_id] = $post_ID;

    So either I can fix these errors OR I can just turn off warnings, which I can't figure out how to do. I know where the Error Reporting value is in the settings file, but what do I need to configure there to turn them off?

    Thanks!

    Christian

  2. hhuskies
    Member
    Posted 16 years ago #

    Okay, so I changed the wp-settings.php error reporting code to this:

    // Report all errors, except notices
    error_reporting(E_ALL ^ E_NOTICE ^ E_WARNING);

    And it stopped the warnings from showing up. Is this proper syntax for that statement?

    BUT, I would still like to know some insights into why I am getting these warnings errors, if you have any ideas.

    Thanks!

About this Topic

  • Started 16 years ago by hhuskies
  • Latest reply from hhuskies