From eeaeae63d09df62e1206f3b4834f6bb290c51fea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Proch=C3=A1zka?= Date: Thu, 20 May 2021 09:40:25 +0200 Subject: [PATCH] Convert primaryKey value to int if it is numeric --- src/DataSource/DoctrineCollectionDataSource.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/DataSource/DoctrineCollectionDataSource.php b/src/DataSource/DoctrineCollectionDataSource.php index 0311644f6..afb33d877 100755 --- a/src/DataSource/DoctrineCollectionDataSource.php +++ b/src/DataSource/DoctrineCollectionDataSource.php @@ -78,6 +78,10 @@ public function getData(): array public function filterOne(array $condition): IDataSource { foreach ($condition as $column => $value) { + if ($column === $this->primaryKey && is_numeric($value)) { + $value = (int) $value; + } + $expr = Criteria::expr()->eq($column, $value); $this->criteria->andWhere($expr); }