SpartnerNL / Laravel-Nova-Excel

🚀 Supercharged Excel exports for Laravel Nova Resources
https://docs.laravel-excel.com/nova/1.0/
MIT License
378 stars 73 forks source link

Exported file contain Javascript content #42

Open Ange7 opened 5 years ago

Ange7 commented 5 years ago

Prerequisites

Versions

Description

When i try to export file, content is Javascript content

Steps to Reproduce

Expected behavior:

My data exported

Actual behavior:

Javascript code inside content

Additional Information

On my project i have json editor plugin loaded (cf: https://github.com/json-editor/json-editor). it seems it's Jsoneditor in content file. Maybe it's a conflict ?

peek 20-02-2019 14-24

patrickbrouwers commented 5 years ago

If you disable json-editor, is the problem gone?

It seems like json-editor is always appending their javascript code, even when it's no needed (download response)

Ange7 commented 5 years ago

If i disable json-editor (and my app react too !), i have the same problem than here : https://github.com/Maatwebsite/Laravel-Nova-Excel/issues/11 (but can't solve it)

smeeckaert commented 5 years ago

Hi, I'm a colleague of Ange7 and I've figured out what was the problem, if the php.ini directive arg_separator.output is not ? (in our case it was & for some reason) the url created in DownloadExcel would be invalid.

And then I don't know why but the $this->validate of the ExcelController would redirect to some other nova-component, hence the javascript content inside the file.

We fixed it with an ini_set('arg_separator.output', '&'); but maybe it should be added to the controller directly.