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 - Prevent bulk delete action on resources with childs #1704

Closed
wants to merge 6 commits into from

Conversation

lguichard
Copy link
Contributor

No description provided.

Copy link

vercel bot commented Apr 20, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
lunar-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 4, 2024 8:27am

@alecritson
Copy link
Collaborator

Thanks @lguichard the only issue I can potentially see with this is calling the relationship like ->attributes->count() is going to lazy load them for each row which is going to result in quite a lot of heavy queries potentially.

Would it be more efficient to modify the query and load the count like $query->withCount(['attributes']) and then change the check to ->attributes_count instead?

@lguichard
Copy link
Contributor Author

@alecritson Thanks for the feedback. It was so obvious that I forgot it 😵‍💫

@alecritson
Copy link
Collaborator

@alecritson Thanks for the feedback. It was so obvious that I forgot it 😵‍💫

Thanks @lguichard I've made one little tweak to the statement logic, hopefully that's alright and makes sense :)

@glennjacobs glennjacobs added this to the v1.0 milestone May 6, 2024
@alecritson alecritson requested a review from glennjacobs May 7, 2024 13:35
@alecritson alecritson linked an issue May 10, 2024 that may be closed by this pull request
@glennjacobs
Copy link
Contributor

@lguichard @alecritson I do agree we have an issue here that needs to be resolved, but the fundamental issue I can see here is that by turning off the bulk update checkbox, we'll not be able to do other bulk updates in the future. I think we need to look at a different approach and we also need to look at the delete buttons on the individual edit pages.

Copy link
Contributor

@glennjacobs glennjacobs left a comment

Choose a reason for hiding this comment

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

See comments made.

@alecritson
Copy link
Collaborator

Thanks for this @lguichard. I'm going to close this PR for now as after some discussion, we are going to take a wider look at deleting across Lunar and address some other concerns that have come up.

@alecritson alecritson closed this Jul 4, 2024
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.

Deleting a collection with child collections causes an error
3 participants