Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
10 changes: 5 additions & 5 deletions src/Enum/ProcessStatusEnum.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Loading