Skip to content

Commit

Permalink
Fix translation keys filter (#934)
Browse files Browse the repository at this point in the history
* Fix translation keys filter

* Apply php-cs-fixer changes

---------

Co-authored-by: fashxp <[email protected]>
  • Loading branch information
2 people authored and kingjia90 committed Jan 31, 2025
1 parent 1663aee commit c942349
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/GraphQL/Resolver/TranslationListing.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,9 @@ public function resolveListing(mixed $value = null, array $args = [], array $con

if (!empty($args['keys'])) {
$keysArray = explode(',', $args['keys']);
$keysString = "'" . implode("','", $keysArray) . "'" ;
$list->setCondition('translations_messages.key IN (' . $keysString . ')');
$keysArray = array_map(fn ($value): string => $list->quote($value), $keysArray);
$keysString = implode(',', $keysArray);
$list->setCondition('`key` IN (' . $keysString . ')');
}

if (!empty($args['languages'])) {
Expand Down

0 comments on commit c942349

Please sign in to comment.