• I’m so lost I don’t even have a good question.

    Error on a plain white screen:

    Notice: Undefined index: post_status in /home/content/h/u/n/hunterhogan/html/wp-admin/includes/post.php on line 206

    Warning: Cannot modify header information – headers already sent by (output started at /home/content/h/u/n/hunterhogan/html/wp-admin/includes/post.php:206) in /home/content/h/u/n/hunterhogan/html/wp-includes/pluggable.php on line 896

    Steps to reproduce

    1. All plugins are deactivated
    2. I reinstalled 3.8.2 from the Update screen
    3. I switched to the Twenty Fourteen theme and I have not made any modifications to it
    4. Go to the Media Library
    5. On the one photo I have in the library, click Edit
    6. Change any information; I have been changing the Caption field
    7. Click Update
    8. The next screen is a plain white screen with the above error message and the URI is https://www.hunterthinks.com/wp-admin/post.php
    9. If I click back or if I navigate back to the image in the Media Library, the changes did apply

    I have no clue what these two errors mean or which part of WordPress generates them. Is “index” referring to the database? The word “header” has multiple meanings, so I’m confused. (e.g., <header>, ‘get_header()’, header.php, the photo is jpg so maybe header is an imprecise preference to metadata)

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter hunterhogan

    (@hunterhogan)

    Select contents from post.php

    Starting with line 185

    // Check if the revisions have been upgraded
    		if ( $revisions && _wp_get_post_revision_version( $revision ) < 1 )
    			_wp_upgrade_revisions_of_post( $post, wp_get_post_revisions( $post_ID ) );
    	}
    
    	$post_data = _wp_translate_postdata( true, $post_data );
    	if ( is_wp_error($post_data) )
    		wp_die( $post_data->get_error_message() );
    	if ( ( empty( $post_data['action'] ) || 'autosave' != $post_data['action'] ) && 'auto-draft' == $post_data['post_status'] ) {
    		$post_data['post_status'] = 'draft';
    	}
    
    	if ( isset($post_data['visibility']) ) {
    		switch ( $post_data['visibility'] ) {
    			case 'public' :
    				$post_data['post_password'] = '';
    				break;
    			case 'password' :
    				unset( $post_data['sticky'] );
    				break;
    			case 'private' :
    				$post_data['post_status'] = 'private';
    				$post_data['post_password'] = '';
    				unset( $post_data['sticky'] );
    				break;
    		}
    	}

    Line 206 says $post_data['post_status'] = 'private';

    ————————————————–

    Select code from pluggable.php starting at line 878

    /**
    	 * Filter the redirect status code.
    	 *
    	 * @since 2.3.0
    	 *
    	 * @param int    $status   Status code to use.
    	 * @param string $location The path to redirect to.
    	 */
    	$status = apply_filters( 'wp_redirect_status', $status, $location );
    
    	if ( ! $location )
    		return false;
    
    	$location = wp_sanitize_redirect($location);
    
    	if ( !$is_IIS && php_sapi_name() != 'cgi-fcgi' )
    		status_header($status); // This causes problems on IIS and some FastCGI setups
    
    	header("Location: $location", true, $status);
    
    	return true;
    }
    endif;
    
    if ( !function_exists('wp_sanitize_redirect') ) :

    Line 896 says header("Location: $location", true, $status);

    Thread Starter hunterhogan

    (@hunterhogan)

    Try re-uploading all files & folders – except the root wp-config.php & .htaccess files and the wp-content folder – from a fresh download of WordPress. Make sure that you delete the old copies of files & folder before uploading the new ones.

    Thread Starter hunterhogan

    (@hunterhogan)

    Thank you.

    I will delete:

    1. /wp-admin/
    2. /wp-includes/
    3. index.php
    4. license.txt
    5. missing.html
    6. readme.html
    7. wp-activate.php
    8. wp-blog-header.php
    9. wp-comments-post.php
    10. wp-config-sample.php
    11. wp-content
    12. wp-cron.php
    13. wp-links-opml.php
    14. wp-load.php
    15. wp-login.php
    16. wp-mail.php
    17. wp-settings.php
    18. wp-signup.php
    19. wp-trackback.php
    20. xmlrpc.php

    I will also delete these files that are unnecessary

    1. .FormMail.conf
    2. webformmailer.php
    3. php.ini
    4. robots.txt

    The first three are some sort of webmail feature provided by GoDaddy. I never use them. My robots.txt only has three lines.

    I will not delete:

    1. index.html
    2. favicon.ico

    Because this is an active website.

    I will not delete:

    1. /wp-content/
    2. .htaccess
    3. wp-config.php

    Contents of .htaccess if it matters (I could probably clean out a few old things)

    DirectoryIndex index.php index.html
    <IfModule mod_mime.c>
    	AddCharset UTF-8 .htm .html .php
    </IfModule>
    <IfModule mod_expires.c>
    	<IfModule mod_headers.c>
    # includes subdirectories
    		ExpiresActive on
    		ExpiresDefault "access plus 7 days"
    # Media
    		<FilesMatch "\.(avi|doc|flv|gif|ico|jpeg|jpg|mov|mp3|pdf|png|ppt|swf|wav|wmv)$">
    			ExpiresDefault "access plus 1 year"
    		</FilesMatch>
    # Markup
    		<FilesMatch "\.(css|js)$">
    			ExpiresDefault "access plus 1 day"
    		</FilesMatch>
    # Content
    		<FilesMatch "\.(htm|html|txt|xml)$">
    			ExpiresDefault "access plus 1 day"
    		</FilesMatch>
    # Index pages
    		<FilesMatch "index\.html$">
    			ExpiresDefault "access plus 10 minutes"
    		</FilesMatch>
    # Dynamic
    		<FilesMatch "\.(cgi|php|pl)$">
    			ExpiresActive Off
    			Header set Cache-Control "private, no-cache, no-store, proxy-revalidate, no-transform"
    			Header set Pragma "no-cache"
    		</FilesMatch>
    	</IfModule>
    </IfModule>
    AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript image/x-icon
    Redirect permanent /blogger/2004...uides.html /blogger/2004/12/study-guides.html
    Redirect permanent /solo/redirect/about_truly_news.html /2008/09/about-truly-news.html
    Redirect permanent /solo/redirect/about_hunter_hogan.html /blogger/2008/09/about-hunter-hogan.html
    Redirect permanent /studyguide/index.html /blogger/2004/12/study-guides.html
    Redirect permanent /studyguide/Ethics/index.html /blogger/2004/12/excelsior-college-ethics-exam-study.html
    Redirect permanent /studyguide/ethics/index.html /blogger/2004/12/excelsior-college-ethics-exam-study.html
    Redirect permanent /studyguide/Ethics/Excelsior_College_Ethics_Exam_Study_Guide.doc /blogger/2004/12/excelsior-college-ethics-exam-study.html
    Redirect permanent /studyguide/ethics/Excelsior_College_Ethics_Exam_Study_Guide.doc /blogger/2004/12/excelsior-college-ethics-exam-study.html
    Redirect permanent /studyguide/gre/index.html /blogger/2004/11/computer-science-gre-study-guide-home.html
    Redirect permanent /studyguide/gre/Computer_Science_GRE_Study_Guide.doc /blogger/2004/11/computer-science-gre-study-guide-home.html
    Redirect permanent /studyguide/gre/Computer_Science_GRE_Study_Guide.doc. /blogger/2004/11/computer-science-gre-study-guide-home.html
    Redirect permanent /studyguide/gre/Computer_Science_GRE_Study_Guide.htm /blogger/2004/11/computer-science-gre-study-guide-home.html
    Redirect permanent /studyguide/gre/studyguide.htm /blogger/2004/11/computer-science-gre-study-guide-home.html
    Redirect permanent /web/IA/index.html /web/
    Redirect permanent /politics/attitudes/index.html /politics/
    Redirect permanent /politics/history/index.html /politics/
    Redirect permanent /politics/iraq/index.html /politics/
    Redirect permanent /politics/policies/index.html /politics/
    Options +FollowSymLinks
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^hunterthinks.com [NC]
    RewriteRule ^(.*)$ https://www.hunterthinks.com/$1 [R=301]
    RewriteCond \.(asp)$ [NC]
    RewriteRule / [R=301,L]
    RewriteRule ^blogger/200\d_\d\d_\d\d_archive.html /blogger/ [R=301,L]
    
    # BEGIN WPSuperCache
    # END WPSuperCache
    
    # BEGIN W3TC Browser Cache
    <IfModule mod_deflate.c>
        <IfModule mod_headers.c>
            Header append Vary User-Agent env=!dont-vary
        </IfModule>
            AddOutputFilterByType DEFLATE text/css text/x-component application/x-javascript application/javascript text/javascript text/x-js text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon application/json
        <IfModule mod_mime.c>
            # DEFLATE by extension
            AddOutputFilter DEFLATE js css htm html xml
        </IfModule>
    </IfModule>
    # END W3TC Browser Cache
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress
    Thread Starter hunterhogan

    (@hunterhogan)

    1. I deleted all of the above files (even missing.html though it was not necessary)
    2. I download 3.8.2 to my local computer and unzipped it
    3. I am uploading all of the files except to /wp-content/ directory

    I live in Cairo, and upload speeds are measured in nanobits per hour, so I try to report back later.

    Thread Starter hunterhogan

    (@hunterhogan)

    Done uploading. I did not make any changes to any file. Followed the above steps to reproduce the problem. The exact same error, including line numbers. I tried updating the file twice and had the same results.

    Upload a new photograph using upload media drag and drop. Click Edit. Add only the word “Caption” to the caption. Click update. Same error. The change was preserved. https://www.hunterthinks.com/?attachment_id=251

    *sigh*
    In wp-config.php, I changed define('WP_DEBUG', true); back to define('WP_DEBUG', false);.

    Error message is gone. I don’t know if that means the actual problems are gone, but the errors are gone.

    I still don’t understand what happened, and I don’t know if I should be worried about migrating to WordPress. If I were a drinker, then I would call it a day and drink alcohol now.

    Try checking your site’s error logs for messages. Your hosts should be able to help you accessing your site’s error logs.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Notice: Undefined index & Warning: Cannot modify header information’ is closed to new replies.