Making WordPress.org

Changeset 9891


Ignore:
Timestamp:
05/19/2020 09:22:55 PM (4 years ago)
Author:
ocean90
Message:

Translate: Log multiple warnings for the same translation.

See #5152.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-custom-stats/stats/warning.php

    r9890 r9891  
    3434        $translation_set = GP::$translation_set->get( $translation->translation_set_id );
    3535
    36         $key = "{$translation->user_id},{$translation_set->locale},{$translation_set->slug},{$project->path},{$translation->id}";
    37 
    3836        foreach( $translation->warnings as $index => $warnings ) {
    3937            foreach ( $warnings as $warning_key => $warning ) {
    40                 $this->warning_stats[ $key ] = $warning_key;
     38                $key = "{$translation->user_id},{$translation_set->locale},{$translation_set->slug},{$project->path},{$translation->id},{$warning_key}";
     39
     40                $this->warning_stats[ $key ] = 1;
    4141            }
    4242        }
     
    5050
    5151        $values = array();
    52         foreach ( $this->warning_stats as $key => $warning ) {
    53             list( $user_id, $locale, $locale_slug, $project_path, $translation_id ) = explode( ',', $key );
     52        foreach ( $this->warning_stats as $key => $_ ) {
     53            list( $user_id, $locale, $locale_slug, $project_path, $translation_id, $warning ) = explode( ',', $key );
    5454
    5555            $values[] = $wpdb->prepare( '(%d, %s, %s, %s, %d, %s, %s)',
Note: See TracChangeset for help on using the changeset viewer.