Skip to content
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]: encode json data on column causing issue #4218

Open
1 task done
Mohammudullah opened this issue Oct 13, 2024 · 4 comments
Open
1 task done

[Bug]: encode json data on column causing issue #4218

Mohammudullah opened this issue Oct 13, 2024 · 4 comments
Labels

Comments

@Mohammudullah
Copy link

Is the bug applicable and reproducable to the latest version of the package and hasn't it been reported before?

  • Yes, it's still reproducable

What version of Laravel Excel are you using?

3.1

What version of Laravel are you using?

10.47.0

What version of PHP are you using?

8.3

Describe your issue

This json structured column {"en":"{\"en\":null,\"bn\":null,\"af\":null,\"bm\":null}","bn":null,"af":null,"bm":null} is affecting other next columns with it's own value
image

How can the issue be reproduced?

using this same json data on a column {"en":"{\"en\":null,\"bn\":null,\"af\":null,\"bm\":null}","bn":null,"af":null,"bm":null}. This will replace other columns data with it's value

What should be the expected behaviour?

the column should not spread to other columns.

@patrickbrouwers
Copy link
Member

Can you explain a bit more what you are trying to do? Are you importing or exporting?
The json decode on export is just a fallback to make clear that something needs to be manually formatted.

@Mohammudullah
Copy link
Author

I'm importing the data from csv. If you can see the image The 'type, price, tag, sku' should contain other columns data from csv. But it's containing 'description' column data

@patrickbrouwers
Copy link
Member

Sounds like you didn't properly escaped the " enclosure in the CSV. The package will see the " and use it as an enclosure.

@Mohammudullah
Copy link
Author

Sounds like you didn't properly escaped the " enclosure in the CSV. The package will see the " and use it as an enclosure.

I can understand that Json structure is not valid. But this data is coming from user. if they somehow mess with this "" enclosure. that csv will not work anymore. I handled invalid Json in my backend with null. so, If csv import can send me what data user entered, I can handle it on backend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants