Skip to content

[289]: add table prefix to SearchTrait filterByQuery - #292

Merged
DenTray merged 6 commits into
masterfrom
289-fix-relation-query-search
Jun 24, 2026
Merged

[289]: add table prefix to SearchTrait filterByQuery#292
DenTray merged 6 commits into
masterfrom
289-fix-relation-query-search

Conversation

@neellii

@neellii neellii commented May 29, 2026

Copy link
Copy Markdown

refs: #289

@neellii neellii assigned vitgrams and unassigned pirs1337 Jun 8, 2026
@neellii
neellii requested a review from vitgrams June 8, 2026 06:06

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1e0f80f0c9

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/Traits/SearchTrait.php Outdated
Comment thread src/Traits/SearchTrait.php Outdated
@vitgrams

vitgrams commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

@DenTray Note: It looks like we have a similar bug in our filters that use the applyWhereCallback method under the hood. It seems worth applying a similar fix to it, as an error will occur if we try to filter by a field with the same name from different tables.

However, this issue will only surface when using joins or a global scope with a join, so it might not be critical for our current use cases. Perhaps some non-trivial custom relation (hasManyThrough) where it will be ambiguous. It's probably best to open a separate ticket for this if we have run into similar problems before.

An ambiguous column in Postgres means 2+ tables in the same FROM clause on the same level, both containing this column. Correlation with an outer table doesn't count here - it is on a different level and loses precedence to the inner table.

@vitgrams vitgrams assigned neellii and unassigned vitgrams Jun 8, 2026
@neellii neellii assigned vitgrams and unassigned neellii Jun 8, 2026
@vitgrams vitgrams assigned DenTray and unassigned vitgrams Jun 10, 2026
Comment thread src/Traits/SearchTrait.php Outdated
@DenTray
DenTray merged commit 3fc6180 into master Jun 24, 2026
12 checks passed
@DenTray
DenTray deleted the 289-fix-relation-query-search branch June 24, 2026 03:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants