Skip to content

Commit

Permalink
fix return of empty translations when filtering with translations
Browse files Browse the repository at this point in the history
  • Loading branch information
abenamier committed Jun 5, 2024
1 parent 85a4e1a commit bffd9c9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 2 additions & 0 deletions Entity/TransUnitRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,8 @@ protected function addTranslationFilter(QueryBuilder $builder, array $locales =

if ((is_countable($ids) ? count($ids) : 0) > 0) {
$builder->andWhere($builder->expr()->in('tu.id', $ids));
} else {
$builder->andWhere($builder->expr()->eq(1, 0));
}
}
}
Expand Down
4 changes: 1 addition & 3 deletions Resources/public/js/grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ function reloadGrid(orderedBy, sort, afterSortClicked, isAfterDelete, maxPageNum
params.push({ name: 'rows', value: 20 });
}

console.log(url);
let urlParams = params.map(function(param) {
return encodeURIComponent(param.name) + '=' + encodeURIComponent(param.value);
}).join('&');
Expand All @@ -190,7 +189,6 @@ function reloadGrid(orderedBy, sort, afterSortClicked, isAfterDelete, maxPageNum
}
}
} else {
console.log(xhr.responseText);
var errorData = JSON.parse(xhr.responseText);
console.error('Error: ' + errorData.status + '\n' + errorData.statusText);
}
Expand Down Expand Up @@ -247,7 +245,7 @@ function filterColumn(column, url) {
if (lastRow.nextElementSibling !== null) {
lastRow.nextElementSibling.remove();
}
console.log(data.total);

if (data.total > 0) {
data.translations.forEach(function(item) {
table += constructHtmlTr(item);
Expand Down

0 comments on commit bffd9c9

Please sign in to comment.