diff --git a/.changes/unreleased/Fixed-20250314-150408.yaml b/.changes/unreleased/Fixed-20250314-150408.yaml new file mode 100644 index 000000000..0c278aa12 --- /dev/null +++ b/.changes/unreleased/Fixed-20250314-150408.yaml @@ -0,0 +1,6 @@ +kind: Fixed +body: fix search query for user groups +time: 2025-03-14T15:04:08.622666838+01:00 +custom: + Issue: "368" + SchemaChange: No schema change diff --git a/src/Bundle/ChillMainBundle/Repository/UserGroupRepository.php b/src/Bundle/ChillMainBundle/Repository/UserGroupRepository.php index e1c54442d..71266f8e5 100644 --- a/src/Bundle/ChillMainBundle/Repository/UserGroupRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/UserGroupRepository.php @@ -75,8 +75,8 @@ final class UserGroupRepository implements UserGroupRepositoryInterface, LocaleA ->setWhereClauses(' ug.active AND ( SIMILARITY(LOWER(UNACCENT(?)), ug.label->>?) > 0.15 - OR ug.label->>? LIKE \'%\' || LOWER(UNACCENT(?)) || \'%\') - ', [$pattern, $lang, $pattern, $lang]); + OR LOWER(UNACCENT(ug.label->>?)) LIKE \'%\' || LOWER(UNACCENT(?)) || \'%\') + ', [$pattern, $lang, $lang, $pattern]); return $query; } diff --git a/src/Bundle/ChillMainBundle/Resources/public/module/pick-entity/index.js b/src/Bundle/ChillMainBundle/Resources/public/module/pick-entity/index.js index 6f6aad7ff..1b3ee4594 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/module/pick-entity/index.js +++ b/src/Bundle/ChillMainBundle/Resources/public/module/pick-entity/index.js @@ -12,10 +12,6 @@ function loadDynamicPicker(element) { let apps = element.querySelectorAll('[data-module="pick-dynamic"]'); apps.forEach(function (el) { - let suggested; - let as_id; - let submit_on_adding_new_entity; - let label; const isMultiple = parseInt(el.dataset.multiple) === 1, uniqId = el.dataset.uniqid, input = element.querySelector( @@ -26,12 +22,12 @@ function loadDynamicPicker(element) { ? JSON.parse(input.value) : input.value === "[]" || input.value === "" ? null - : [JSON.parse(input.value)]; - suggested = JSON.parse(el.dataset.suggested); - as_id = parseInt(el.dataset.asId) === 1; - submit_on_adding_new_entity = - parseInt(el.dataset.submitOnAddingNewEntity) === 1; - label = el.dataset.label; + : [JSON.parse(input.value)], + suggested = JSON.parse(el.dataset.suggested), + as_id = parseInt(el.dataset.asId) === 1, + submit_on_adding_new_entity = + parseInt(el.dataset.submitOnAddingNewEntity) === 1, + label = el.dataset.label; if (!isMultiple) { if (input.value === "[]") {