-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[BUG] globalscopes are not applied on export #2730
Comments
I would need to see a bit more code, I'm not sure what "static" points to and I can't see what kind of query you use. |
the query is simple as |
Can you try putting that global scope in a service provider, I'm not sure the booted callbacks gets called due to performance reasons. |
actually |
I'm not saying it isn't. I'm trying to find out why it's not being called. |
yeah i understand, np i will give it a try. note that using through a service provider will make it take longer for the fw to resolve the class and its binding b4 using it. |
sorry for the late reply, tried the service provider but sadly gave the same result. |
Are you using from query and should queue? |
using |
i believe the issue is with the export function not the query, because i can get a correct sql. |
It seems Laravel's chunk/chunkById methods don't respect the global scopes. They work when I specify the orderBy on the query itself. You could try to reproduce without this package and see:
Not sure if bug in Laravel or if it's intended to work like this. |
i've tried to search if others had the same issue, only one ticket was made but then closed at the same day without any further details. maybe we can try to use cursors instead ? which is better than chunking for large data sets. |
That will be the default in 3.2 yes. In 3.1 you can return the cursor in the collection method |
so this bug should be fixed in next version u mean ? |
Yes it should work out of the box in the next version |
any estimation when will that be ? |
Sorry, I don't have any ETA for it.
^ this should already be enough for you I think |
i dont think this would work with the query setup, still thanx again, if you want u can close this ticket. |
It would replace the |
Prerequisites
Versions
PHP 7.4.7 (cli) (built: Jun 12 2020 00:00:24) ( NTS )
Laravel Framework 7.17.2
3.1.19
Description
package doesn't respect the global-scopes on export ex.
query is correct ex.
but the exported sheet is not sorted.
Steps to Reproduce
query
Expected behavior:
Actual behavior:
The text was updated successfully, but these errors were encountered: