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

[7.x] Check if relationship method exists before calling it #647

Merged

Conversation

BobWez98
Copy link
Contributor

@BobWez98 BobWez98 commented Jan 2, 2025

In our situation we have a field "products" in a page builder fieldset, it is a HasMany field that links to the Product runway model. However there's no relationship set on the models so we're getting the error "called to undefined method "products". This way the field will check if the relationship exists before calling the method.

@BobWez98 BobWez98 changed the title Check if relationship method exists before calling it [7.x] Check if relationship method exists before calling it Jan 2, 2025
Copy link
Member

@duncanmcclean duncanmcclean left a comment

Choose a reason for hiding this comment

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

Thanks!

@duncanmcclean duncanmcclean merged commit 76aa95b into statamic-rad-pack:7.x Jan 6, 2025
12 checks passed
Copy link

github-actions bot commented Jan 6, 2025

Released as part of v7.13.4.

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.

2 participants