Making WordPress.org

Changeset 9893


Ignore:
Timestamp:
05/20/2020 04:20:24 PM (21 months ago)
Author:
ocean90
Message:

Translate: Include the message of a warning in translation warnings logging.

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

    r9891 r9893  
    3838                $key = "{$translation->user_id},{$translation_set->locale},{$translation_set->slug},{$project->path},{$translation->id},{$warning_key}";
    3939
    40                 $this->warning_stats[ $key ] = 1;
     40                $this->warning_stats[ $key ] = $warning;
    4141            }
    4242        }
     
    5050
    5151        $values = array();
    52         foreach ( $this->warning_stats as $key => $_ ) {
     52        foreach ( $this->warning_stats as $key => $message ) {
    5353            list( $user_id, $locale, $locale_slug, $project_path, $translation_id, $warning ) = explode( ',', $key );
    5454
    55             $values[] = $wpdb->prepare( '(%d, %s, %s, %s, %d, %s, %s)',
     55            $values[] = $wpdb->prepare( '(%d, %s, %s, %s, %d, %s, %s, %s)',
    5656                $user_id,
    5757                $locale,
     
    6060                $translation_id,
    6161                $warning,
    62                 $now
     62                $now,
     63                $message
    6364            );
    6465
     
    6667            if ( count( $values ) > 50 ) {
    6768                $wpdb->query(
    68                     "INSERT INTO {$wpdb->dotorg_translation_warnings} (`user_id`, `locale`, `locale_slug`, `project_path`, `translation_id`, `warning`, `timestamp`)
     69                    "INSERT INTO {$wpdb->dotorg_translation_warnings} (`user_id`, `locale`, `locale_slug`, `project_path`, `translation_id`, `warning`, `timestamp`, `message`)
    6970                    VALUES " . implode( ', ', $values )
    7071                );
     
    7576        if ( $values ) {
    7677            $wpdb->query(
    77                 "INSERT INTO {$wpdb->dotorg_translation_warnings} (`user_id`, `locale`, `locale_slug`, `project_path`, `translation_id`, `warning`, `timestamp`)
     78                "INSERT INTO {$wpdb->dotorg_translation_warnings} (`user_id`, `locale`, `locale_slug`, `project_path`, `translation_id`, `warning`, `timestamp`, `message`)
    7879                VALUES " . implode( ', ', $values )
    7980            );
     
    9495  `warning` varchar(20) NOT NULL DEFAULT '',
    9596  `timestamp` datetime NOT NULL default '0000-00-00 00:00:00',
     97  `message` longtext
    9698  PRIMARY KEY (`id`)
    9799) ENGINE=InnoDB DEFAULT CHARSET=latin1;
Note: See TracChangeset for help on using the changeset viewer.