Making WordPress.org


Ignore:
Timestamp:
09/11/2015 04:48:04 AM (9 years ago)
Author:
dd32
Message:

Translate: Don't log a warning twice in a single request. This can occur when a translation editor triggers a warning as we both save and approve the string in one move.

See #1229

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/translate.wordpress.org/includes/gp-plugins/wporg-log-warnings-to-slack.php

    r1869 r1870  
    99
    1010    var $channel = '#polyglots-warnings';
     11
     12    // Holds the list of Translation ID's which have been notified about in this process
     13    var $warned = array();
    1114
    1215    function __construct() {
     
    5861     */
    5962    function process_translation_warning( $translation ) {
     63        // Avoid processing a specific translation twice
     64        if ( isset( $this->warned[ $translation->id ] ) ) {
     65            return;
     66        }
     67        $this->warned[ $translation->id ] = true;
     68
     69
    6070        $original = GP::$original->get( $translation->original_id );
    6171        $set = GP::$translation_set->get( $translation->translation_set_id );
Note: See TracChangeset for help on using the changeset viewer.