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

Fix support for BelongsToThrough relationships in Select/SelectFilter #8026

Merged
merged 7 commits into from
Sep 9, 2023

Conversation

dchatry
Copy link
Contributor

@dchatry dchatry commented Aug 23, 2023

  • Changes have been thoroughly tested to not break existing functionality.
    See examples below.
  • New functionality has been documented or existing documentation has been updated to reflect changes.
    No need for docs changes, works as documented.
  • Visual changes are explained in the PR description using a screenshot/recording of before and after.
    No visual changes.

This PR fixes support for staudenmeir/belongs-to-through relationships which used to be (at least partially) supported in V2.

Changes in packages/forms/src/Components/Select.php handle the proper key retrieval for this type of relationship for select population and searching.

A distinct() was added to the relationship query in packages/tables/src/Filters/SelectFilter.php to de-duplicate values used to build indicator labels.

Before:
image

After:
image

@danharrin danharrin added the bug Something isn't working label Aug 24, 2023
@danharrin danharrin added this to the v3 milestone Aug 24, 2023
@danharrin danharrin merged commit b32fddf into filamentphp:3.x Sep 9, 2023
2 of 4 checks passed
@danharrin
Copy link
Member

Thanks!

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.

None yet

2 participants