From 13d80412a63916d12664a459343be582ff7bd2e0 Mon Sep 17 00:00:00 2001 From: Mathieu Ducrot Date: Thu, 16 Apr 2026 12:32:04 +0200 Subject: [PATCH] CU-869cmd6gg Patch version to fix ProcessStatusEnum::addQbOrderBy for the nb binding param error --- CHANGELOG.md | 4 ++++ src/Enum/ProcessStatusEnum.php | 10 +++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7bae210..59f7348 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ CHANGELOG for 1.x =================== +## v1.17.1 - (2026-04-16) +### Fixed +- `ProcessStatusEnum::addQbOrderBy` : Switch to inline param to prevent nb binding param due to the BaseEntityProvider resetDQLPart onorderBy + ## v1.17.0 - (2026-02-25) ### Added - Allow Symfony 7.4 diff --git a/src/Enum/ProcessStatusEnum.php b/src/Enum/ProcessStatusEnum.php index dd03a1f..a73bc7f 100644 --- a/src/Enum/ProcessStatusEnum.php +++ b/src/Enum/ProcessStatusEnum.php @@ -61,17 +61,17 @@ public static function labels(TranslatorInterface $translator): array public static function addQbOrderBy(QueryBuilder $qb, string $field, string $order, string $alias = 'o', ?string $jsonProperty = null): void { - if ($jsonProperty !== null) { + if (null !== $jsonProperty) { $sort = "FIELD(JSON_UNQUOTE(JSON_EXTRACT($alias.$jsonProperty, '$.$field'))"; } else { $sort = "FIELD(ANY_VALUE($alias.$field)"; } foreach (self::cases() as $case) { - $sortParamName = ":{$field}_sort_" . $case->value; - $sort .= ', ' . $sortParamName; - $qb->setParameter($sortParamName, $case->value); + // MDT Pass params inline rather than via setParameter to avoid a binding error on the number of params during sorting + // Because during $countQb by the BaseEntityProvider there is a resetDQLPart on the orderBy which causes the mention error + $sort .= ", '{$case->value}'"; } $sort .= ')'; - $qb->orderBy($sort, $order); // @phpcs:ignore + $qb->orderBy($sort, $order); // phpcs:ignore } }