Laravel-Nova-Excel icon indicating copy to clipboard operation
Laravel-Nova-Excel copied to clipboard

Exported file contain Javascript content

Open Ange7 opened this issue 5 years ago • 3 comments

Prerequisites

  • [ ] Able to reproduce the behaviour outside of your code, the problem is isolated to Laravel Excel.
  • [X] Checked that your issue isn't already filed.
  • [X] Checked if no PR was submitted that fixes this problem.

Versions

  • PHP version: 7.1.7
  • Laravel version: 5.7.26
  • Nova version: 1.3.1
  • Package version: 3.1 & 1.1

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

Ange7 avatar Feb 20 '19 13:02 Ange7

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)

patrickbrouwers avatar Feb 20 '19 16:02 patrickbrouwers

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)

Ange7 avatar Feb 20 '19 17:02 Ange7

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.

smeeckaert avatar Mar 14 '19 12:03 smeeckaert