Laravel-Backpack / revise-operation

An admin interface for venturecraft/revisionable - audit log for your Eloquent entries.
Other
42 stars 10 forks source link

Prevent lazy loading fails on ReviseOperation #22

Closed Rian190 closed 1 year ago

Rian190 commented 1 year ago

I am trying to add prevent lazy loading in my app by using PreventLazyLoading.

The ReviseOperation fails when loading the revision history. The root cause is a foreach loop in the Search trait:

Might this be something to rethink in the Backpack sourcecode? Or should I think about ignoring this specific case?

pxpm commented 1 year ago

Hey @Rian190 thanks for the heads up. 🙏

This is something we should fix on our side 100%. ✅

Please add it to ignore list for now to have it working, but I am converting this to an issue and we will work on the solution 👍

Thanks again!

welcome[bot] commented 1 year ago

Hello there! Thanks for opening your first issue on this repo!

Just a heads-up: Here at Backpack we use Github Issues only for tracking bugs. Talk about new features is also acceptable. This helps a lot in keeping our focus on improving Backpack. If you issue is not a bug/feature, please help us out by closing the issue yourself and posting in the appropriate medium (see below). If you're not sure where it fits, it's ok, a community member will probably reply to help you with that.

Backpack communication channels:

Please keep in mind Backpack offers no official / paid support. Whatever help you receive here, on Gitter, Slack or Stackoverflow is thanks to our awesome awesome community members, who give up some of their time to help their peers. If you want to join our community, just start pitching in. We take pride in being a welcoming bunch.

Thank you!

-- Justin Case The Backpack Robot

Rian190 commented 1 year ago

Thank you for the quick response.

As reference for others; I have created this exception by the following code:

        Model::preventLazyLoading(! app()->isProduction() && !str_ends_with(request()->url(), 'search'));

No guaranty this will work in all backpack functionality.

pxpm commented 1 year ago

I've submitted #23 that should address this issue.

I will be closing this issue report since we already have the fix, it should be merged soon.

If you find other cases that we missed, please open a new issue report and we will take a look. 👀

Thank you very much for raising this issue and providing the workaround 🙏

Cheers