Commit 79fa4a7d authored by Felip Manyer i Ballester's avatar Felip Manyer i Ballester
Browse files

Issue #3282696: Port of l10n_community: translation form (properly unapprove suggestion strings)

parent fc4703df
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -507,13 +507,16 @@ class L10nPo {
    $time = \Drupal::time()->getRequestTime();

    // Make the existing approved string a suggestion (if applicable).
    // There should only ever be one string like this.
    // There should only ever be one string like this, but you know, errors
    // happen.
    $translations = $translation_storage->loadByProperties([
      'sid' => $sid,
      'language' => $langcode,
      'suggestion' => 0,
      'status' => 1,
    ]);
    /** @var \Drupal\l10n_server\Entity\L10nServerTranslationInterface $translation */
    if ($translation = reset($translations)) {
    foreach ($translations as $translation) {
      $translation
        ->set('suggestion', 1)
        ->set('changed', $time);