Making WordPress.org

Changeset 11068


Ignore:
Timestamp:
06/26/2021 02:07:54 PM (3 years ago)
Author:
ocean90
Message:

Translate, Plugin Directory: During translation sync also discard warnings for existing translations.

Fixes #3828.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-plugin-directory/inc/sync/class-translation-sync.php

    r8156 r11068  
    244244
    245245            if ( $existing_translation === $new_translation ) {
     246                // Translations are only synced if they have no warnings.
     247                // If the existing translation still has warnings discard them automatically.
     248                if ( $_existing_translation->warnings ) {
     249                    $_existing_translation->warnings = null;
     250                    $_existing_translation->save();
     251                }
     252
    246253                $_existing_translation->set_as_current();
    247254                gp_clean_translation_set_cache( $new_translation_set->id );
     
    251258        }
    252259
     260        // Create a new translation.
    253261        $copy = new GP_Translation( $translation->fields() );
    254262        $copy->original_id = $new_original->id;
Note: See TracChangeset for help on using the changeset viewer.