• I’ve successfully automatically upgraded WP to the latest version with the sole exception that when I try to upgrade the database I get this message:

    Fatal error: Call to undefined function: populate_roles_270() in /home/em/emp/employment-one.com/public/www/blog/wp-admin/includes/upgrade.php on line 904

    The upgrade.php file has permissions set correctly.

    Any help appreciated.

    Robin
    https://www.e1jobs-blog.com

Viewing 5 replies - 1 through 5 (of 5 total)
  • populate_roles_270 should be the last function in wp-admin/includes/schema.php so you may need to upload that file again. Possibly it was missed out.

    Thread Starter Robinoz

    (@robinoz)

    Thanks. I’ll give it a go.

    Robin

    Thread Starter Robinoz

    (@robinoz)

    Resolved. Here’s the problem:

    The file wp-admin/includes/upgrade.php includes the line that relates to populate_roles_270, however in the schema.php file you referred to, the last command is actually populate_roles_260 as you said.

    I simply changed the 270 to 260 and it worked.

    Perhaps the people responsible for programming need to make the change to rectify this matter.

    Thanks for your help.

    Robin

    Thread Starter Robinoz

    (@robinoz)

    Now the following error occurs while trying to load Admin:

    Fatal error: Call to undefined function: favorite_actions() in /home/em/emp/employment-one.com/public/www/blog/wp-admin/admin-header.php on line 113

    I’ll enter a new topic about this elsewhere.

    Robin

    youre messing with stuff that you shouldnt be messing with:

    the original function is defined and used inside schema.php and theres nothing wrong with it or the original file.

    wp-admin/includes/upgrade.php:

    function upgrade_270() {
    	global $wpdb, $wp_current_db_version;
    
    	if ( $wp_current_db_version < 8980 )
    		populate_roles_270();

    wp-admin/includes/schema.php:

    function populate_roles() {
    	populate_roles_160();
    	populate_roles_210();
    	populate_roles_230();
    	populate_roles_250();
    	populate_roles_260();
    	populate_roles_270();
    }
    function populate_roles_270() {
    	$role = get_role( 'administrator' );
    
    	if ( !empty( $role ) ) {
    		$role->add_cap( 'install_plugins' );
    		$role->add_cap( 'update_themes' );
    	}
    }

    as was previously told to you, your file is incomplete, and instead of changing the code, you needed to upload a fresh. complete, file.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Database Upgrade Error in Upgrade.php File’ is closed to new replies.