Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow bigint in search #6338

Open
wants to merge 1 commit into
base: 4.x
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion src/Orm/EntityRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ private function addSearchClause(QueryBuilder $queryBuilder, SearchDto $searchDt
$lowercaseQueryTerm = mb_strtolower($queryTerm);
$isNumericQueryTerm = is_numeric($queryTerm);
$isSmallIntegerQueryTerm = ctype_digit($queryTerm) && $queryTerm >= -32768 && $queryTerm <= 32767;
$isIntegerQueryTerm = ctype_digit($queryTerm) && $queryTerm >= -2147483648 && $queryTerm <= 2147483647;
$isIntegerQueryTerm = ctype_digit($queryTerm) && $queryTerm >= -9223372036854775808 && $queryTerm <= 18446744073709551617;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$isIntegerQueryTerm = ctype_digit($queryTerm) && $queryTerm >= -9223372036854775808 && $queryTerm <= 18446744073709551617;
$isIntegerQueryTerm = ctype_digit($queryTerm) && $queryTerm >= \PHP_INT_MIN && $queryTerm <= \PHP_INT_MAX;

Copy link
Contributor

@Seb33300 Seb33300 Jun 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably not the correct way to fix it.
I think you need to create a new condition specific for big int here:
https://github.com/simoheinonen/EasyAdminBundle/blob/6248349de0e108640b78bef70656db6f35f7386c/src/Orm/EntityRepository.php#L290-L292

$isUuidQueryTerm = Uuid::isValid($queryTerm);
$isUlidQueryTerm = Ulid::isValid($queryTerm);

Expand Down
Loading