Forums

Database Upgrade Error in Upgrade.php File (6 posts)

  1. Robinoz
    Member
    Posted 3 years ago #

    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
    http://www.e1jobs-blog.com

  2. mrmist
    Forum Janitor
    Posted 3 years ago #

    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.

  3. Robinoz
    Member
    Posted 3 years ago #

    Thanks. I'll give it a go.

    Robin

  4. Robinoz
    Member
    Posted 3 years ago #

    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

  5. Robinoz
    Member
    Posted 3 years ago #

    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

  6. whooami
    Member
    Posted 3 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic