WordPress.org

Make WordPress Core

Changeset 25781


Ignore:
Timestamp:
10/14/13 23:32:47 (4 years ago)
Author:
nacin
Message:

Automatic updates: Include error data in the follow-up API request.

props dd32.
see #22704.

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-upgrader.php

    r25777 r25781  
    17481748            delete_site_transient( 'update_core' ); 
    17491749            $extra_update_stats['success'] = is_wp_error( $core_update_result ) ? $core_update_result->get_error_code() : true; 
     1750            $extra_update_stats['error_data'] = is_wp_error( $core_update_result ) ? $core_update_result->get_error_data() : ''; 
    17501751            if ( is_wp_error( $core_update_result ) && 'rollback_was_required' == $core_update_result->get_error_code() ) { 
    17511752                $rollback_data = $core_update_result->get_error_data(); 
    17521753                $extra_update_stats['success'] = is_wp_error( $rollback_data['update'] ) ? $rollback_data['update']->get_error_code() : $rollback_data['update']; 
     1754                $extra_update_stats['error_data'] = is_wp_error( $rollback_data['update'] ) ? $rollback_data['update']->get_error_data() : ''; 
    17531755                $extra_update_stats['rollback'] = is_wp_error( $rollback_data['rollback'] ) ? $rollback_data['rollback']->get_error_code() : true; // If it's not a WP_Error, the rollback was successful. 
     1756                $extra_update_stats['rollback_data'] = is_wp_error( $rollback_data['rollback'] ) ? $rollback_data['rollback']->get_error_data() : ''; 
    17541757            } 
    17551758            $extra_update_stats['fs_method'] = $GLOBALS['wp_filesystem']->method; 
     1759            $extra_update_stats['fs_method_forced'] = defined( 'FS_METHOD' ) || has_filter( 'fs_method' ); 
    17561760            $extra_update_stats['time_taken'] = ( time() - $start_time ); 
    17571761            $extra_update_stats['attempted'] = $core_update->version; 
  • trunk/src/wp-includes/update.php

    r25751 r25781  
    8787    ); 
    8888 
     89    $post_body = array( 
     90        'translations' => json_encode( $translations ), 
     91    ); 
     92 
    8993    if ( $extra_stats ) 
    90         $query = array_merge( $query, $extra_stats ); 
     94        $post_body = array_merge( $post_body, $extra_stats ); 
    9195 
    9296    $url = 'http://api.wordpress.org/core/version-check/1.7/?' . http_build_query( $query, null, '&' ); 
     
    101105            'wp_blog' => home_url( '/' ) 
    102106        ), 
    103         'body' => array( 
    104             'translations' => json_encode( $translations ), 
    105         ), 
     107        'body' => $post_body, 
    106108    ); 
    107109 
Note: See TracChangeset for help on using the changeset viewer.