Skip to content

[BUGFIX] Fix findBySearchTermInBackendMode() with Postgres#977

Merged
AnReiter merged 1 commit into
mainfrom
bugfix/postgres
May 1, 2026
Merged

[BUGFIX] Fix findBySearchTermInBackendMode() with Postgres#977
AnReiter merged 1 commit into
mainfrom
bugfix/postgres

Conversation

@oliverklee
Copy link
Copy Markdown
Collaborator

With Postgres, we cannot use LIKE for integer fields.

Fixes #976

With Postgres, we cannot use `LIKE` for integer fields.

Fixes #976
@oliverklee oliverklee requested a review from AnReiter April 30, 2026 17:58
@oliverklee oliverklee self-assigned this Apr 30, 2026
@oliverklee oliverklee added the bug Something isn't working label Apr 30, 2026
@coveralls
Copy link
Copy Markdown

Coverage Report for CI Build 25181083397

Coverage remained the same at 100.0%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: 7 of 7 lines across 1 file are fully covered (100%).
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 234
Covered Lines: 234
Line Coverage: 100.0%
Coverage Strength: 6.02 hits per line

💛 - Coveralls

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes a Postgres-specific failure in FrontendUserRepository::findBySearchTermInBackendMode() by avoiding LIKE/string comparisons against the integer uid field.

Changes:

  • Introduce a SEARCH_FIELDS constant to centralize the list of text fields searched via LIKE.
  • Only add the uid equality constraint when the search term is purely numeric (preventing Postgres integer-cast errors).
  • Add a changelog entry documenting the fix.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
Classes/Domain/Repository/FrontendUserRepository.php Prevents invalid integer comparisons on Postgres by conditionally adding the uid matcher and refactoring LIKE matchers into a field list.
CHANGELOG.md Documents the Postgres fix in the “Fixed” section.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@AnReiter AnReiter merged commit e6c89fa into main May 1, 2026
28 checks passed
@AnReiter AnReiter deleted the bugfix/postgres branch May 1, 2026 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Postgres error: Invalid input syntax for integer

4 participants