Making WordPress.org

Changeset 3469


Ignore:
Timestamp:
06/19/2016 12:27:19 PM (9 years ago)
Author:
dd32
Message:

Plugin Directory: Avoid fatal erros on import after r3467 when the user can't be found, trigger a Jetpack Search re-import after incase the post has changed.

See #1584

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/cli/class-import.php

    r3467 r3469  
    176176        // Give committers a role on this site.
    177177        foreach ( Tools::get_plugin_committers( $plugin_slug ) as $committer ) {
    178             $user = get_user_by( 'slug', $committer );
    179 
    180             if ( ! user_can( $user, 'plugin_dashboard_access' ) ) {
     178            $user = get_user_by( 'login', $committer );
     179
     180            if ( $user && ! user_can( $user, 'plugin_dashboard_access' ) ) {
    181181                $user->add_role( 'plugin_committer' );
    182182            }
     
    189189        // Finally, set the new version live.
    190190        update_post_meta( $plugin->ID, 'stable_tag', $stable_tag );
     191
     192        // Update Jetpack Search
     193        \Jetpack::$instance->sync->register_post( $plugin->ID );
    191194    }
    192195
Note: See TracChangeset for help on using the changeset viewer.