Commit 3fe7ad69 authored by Felip Manyer i Ballester's avatar Felip Manyer i Ballester Committed by Felip Manyer i Ballester
Browse files

Issue #3325390 by FMB: Pager seems to act on suggestions, not source strings

parent e03d09f2
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -81,14 +81,19 @@ class L10nTranslator {
   */
  public function getStrings(string $langcode, array $filters, int $pager = NULL): array {
    $query = $this->connection
      ->select('l10n_server_string', 's')
      ->distinct();
      ->select('l10n_server_string', 's');
    $query
      ->leftJoin('l10n_server_status_flag', 'ts', 's.sid = ts.sid AND ts.language = :language', [
        ':language' => $langcode,
      ]);
    $query
      ->leftJoin('l10n_server_translation', 't', 'ts.sid = t.sid AND ts.language = t.language AND t.status = 1');
    // The translation table has a 1:N relationship to sources. We need to limit
    // results to unique sids. A group by on sid appears to be the fastest
    // solution (as opposed to eg. DISTINCT).
    // @note the D7 version also applied a groupBy('NULL'), but it just makes
    // the query crash.
    $query->groupBy('sid');
    $query
      ->leftJoin('users_field_data', 'u', 'u.uid = t.uid');
    $query