-
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
Queued Export Failing on Export of hasMany related model #43
Comments
Could you perhaps include the PHP & Laravel versions as well? Thanks! |
Added. Thanks for maintaining this awesome plugin. |
Do you have a full stack trace of the exception/error? |
Sorry for the readability, but what I have for now is this screenshot here. When I get back to a computer in 24h, I can also provide the text output. |
This is fine, thanks! |
FYI - we are fixing this via abstracting the
|
Problem
QueuedExport
of ahasMany
related model. In our case, we haveClients
hasManyDocuments
and we would like to export theDocuments
under theClient
view. The parameters that we used are:AppendQueryToSheet
job appears to be returning an error. The error appears to trace to$row
onmap($row)
being an object and not an array.https://github.com/Maatwebsite/Laravel-Nova-Excel/blob/806cafa2cf38de9a8f6c8cbc835445f406148b69/src/Actions/ExportToExcel.php#L227
Diagnosis
If we turn the $row object into an array (e.g.
$row = (array) $row;
), the queued export works also as normal. (I did this directly on the vendor file as a hack to test)https://github.com/Maatwebsite/Laravel-Nova-Excel/blob/806cafa2cf38de9a8f6c8cbc835445f406148b69/src/Actions/ExportToExcel.php#L227,
If we change the action from
QueuedExport
toExportToExcel
, the export works so the issue appears to lie in the queueing mechanic.Note: Exports on the Document resource works perfectly fine. It’s only an issue when expiring Documents from the Client resource view.
Any assistance is appreciated.
Version Used
Laravel-Nova-Excel: v1.10
Laravel: 5.7
PHP: 7.2
The text was updated successfully, but these errors were encountered: