-
Notifications
You must be signed in to change notification settings - Fork 74
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
QueuedExport doesn't allow softDeleted data #136
Comments
Hey @yahya077 can you share the query please |
Hi @patrickbrouwers , let me explain myself. I extended my custom class with QueuedExport. In the __sleep function $this->request->query->get('trashed') returns 'only' but it has to return 'with' because i needed with softDeleted datas. If i set trashed as 'with' in '__sleep' function it returns serialization error. |
In the model resource when i override indexQuery with
Its changing the trashed but QueuedExport doesn't using that parameter. Maybe QueuedExport creating a new query. |
I'm not familiar with set('trashed'). The package that serializes the query has support for trashed/soft deleted: https://github.com/laravie/serialize-queries/blob/master/tests/Feature/EloquentTest.php#L87 I guess it would be best if you could try to create an easy to reproduce scenario, so I can share it with the package author |
If you want to set only trashed you have to do it during or before
|
I think indeed the request won't be correctly searialized for the wakekup. Perhaps add some logging to check what the value is within that indexQuery at the moment it does the _wakeup |
Alright, let me give you the sceneario. My Nova Resource in actions
My CustomExcelExport class
The problemThe data doesn't returns with deleted ones. What I triednote: these substances are tried separately.
|
As you are already using a custom export class, you can probably better just overwrite the query method there. |
Well, I also tried that earlier but It also doesn't work. Why? Let me explain. The query function is not doing its job. I check the all query after i queried. There is a 'where is null deleted_at' query. It seems like before the query function some query prepared already. If you try it you will see that extra query will broke the code. |
It would be a lot easier if you could give a full reproduction scenario, this is quite hard to puzzle together to what you are exactly trying. If you could make a reproduction repository with the most simple situation that will make it less time consuming to look into, without it I won't have time to look into it. |
Versions
Description
After softDeleted data selected, QueuedExport doesn't get deleted ones. DownloadExcel class does that.
Additional Information
(new CustomExcelExport())->withDisk('media')->askForFilename(),
The implementations are WithMapping,WithHeadings
The traits are InteractsWithQueue, Queueable;
The text was updated successfully, but these errors were encountered: