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: used new parent relation on instanceof control for has one through #15265

Conversation

musaberatbahadir
Copy link
Contributor

Description

fix for the issue I created. CreateAction is checking the correct class on instance of control now.

@musaberatbahadir musaberatbahadir changed the title used new parent relation on instanceof control for has one through Fix: used new parent relation on instanceof control for has one through Jan 6, 2025
@danharrin danharrin added the bug Something isn't working label Jan 7, 2025
@danharrin danharrin added this to the v3 milestone Jan 7, 2025
Copy link
Member

@danharrin danharrin left a comment

Choose a reason for hiding this comment

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

This would break Laravel 10.x compatibility, right? Can you do a class_exists() check and check the correct parent class based on that please?

@musaberatbahadir
Copy link
Contributor Author

@danharrin I've added the check you have mentioned above

@musaberatbahadir
Copy link
Contributor Author

musaberatbahadir commented Jan 7, 2025

@danharrin I also realized that instanceof HasManyThrough control causes other errors on my project like in Filament\Tables\Table\Concerns\HasQuery, do you want me to replace all of them as I did on the last commit, or do you wanna introduce some config level check by controlling laravel version or class_exists function?
there are 6 more instanceof HasManyThrough control

@danharrin
Copy link
Member

Please can you do the class_exists() in all places?

@musaberatbahadir
Copy link
Contributor Author

Done! @danharrin

Copy link
Member

Choose a reason for hiding this comment

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

Does the return type of getRelationship() need updating? Any other references to this class?

Copy link
Member

Choose a reason for hiding this comment

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

If we did, I think we would need to retain both HasManyThrough and HasOneOrManyThrough on the return type for backwards compatibility, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch! I fixed that too.

@danharrin danharrin merged commit 876f612 into filamentphp:3.x Jan 10, 2025
10 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
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants