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]: json_decode(): Argument #1 ($json) must be of type string, array given when using custom fields #54

Closed
DivByZeroIT opened this issue Oct 30, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@DivByZeroIT
Copy link

What happened?

After following the configuration to enable custom fields, if I go in the edit profile page I get a json_decode(): Argument #1 ($json) must be of type string, array given error.

this happens when in the user model custom_fields is (correctly) casted as array. If I remove the cast as array the edit profile page works.

How to reproduce the bug

Just enable the cast as array of custom_fields in the user model

Package Version

1.0.31

PHP Version

8.2

Laravel Version

11.x

Which operating systems does with happen with?

macOS

Notes

No response

@DivByZeroIT DivByZeroIT added the bug Something isn't working label Oct 30, 2024
@DivByZeroIT
Copy link
Author

The error trace back to $this->form->fill(json_decode($data['custom_fields'], true) ?? []); in vendor/joaopaulolndev/filament-edit-profile/src/Livewire/CustomFieldsForm.php

@mkeremcansev
Copy link
Contributor

@DivByZeroIT Hey, I solved this error in the following PR #55

@joaopaulolndev
Copy link
Owner

PR #55
Merged to fix this issue

@DivByZeroIT
Copy link
Author

Thanks Joao!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants