JTK – Notes and Ramblings Things we have found …

4/2/2020

Updates to WP – fixing the blank editor

Filed under: General — taing @ 9:14 am

I did the automatic update to WordPress 5.4 last night and things got weird. The editor was causing php errors. The browser page appeared blank but turning on developer tools showed there was a pile of stuff including a message to look at https://wordpress.org/support/article/debugging-in-wordpress/

Time to turn on debugging by adding this bit to wp/wp-config.php:

// Enable WP_DEBUG mode
define( 'WP_DEBUG', true );

// Enable Debug logging to the /wp-content/debug.log file
define( 'WP_DEBUG_LOG', true );

// Enable display of errors and warnings
define( 'WP_DEBUG_DISPLAY', true );
@ini_set( 'display_errors', 0 );

// Use dev versions of core JS and CSS files (only needed if you are modifying these core files)
define( 'SCRIPT_DEBUG', true );

This revealed several errors and warnings. The primary one was solved by removing an ancient but in theory up to date plug-in for Movable Type and TypePad import.

The remaining errors were: register_sidebar was called incorrectly. No id was set in the arguments array for the "Sidebar 1" sidebar. Defaulting to "sidebar-1". Manually set the id to "sidebar-1" to silence this notice and keep existing sidebar content. causing several Cannot modify header information - headers already sent by (output started at /home/taing/jtkdev.com/wp/wp-includes/functions.php:5167) in /home/taing/jtkdev.com/wp/wp-includes/functions.php on line 6221

In looking at wp-content/themes/classic/functions.php there is very little there. By removing the block below the error messages are gone and the pages seem to display correctly:

if ( function_exists('register_sidebar') )
        register_sidebar(array(
                'before_widget' => '<li id="%1$s" class="widget %2$s">',
                'after_widget' => '</li>',
                'before_title' => '',
                'after_title' => '',
        ));

No Comments

No comments yet.

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

Powered by WordPress