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

Error "Array to string conversion" when create with multiple data #37

Closed
ikkosatrio opened this issue Jul 31, 2019 · 9 comments · Fixed by #38
Closed

Error "Array to string conversion" when create with multiple data #37

ikkosatrio opened this issue Jul 31, 2019 · 9 comments · Fixed by #38
Assignees
Labels

Comments

@ikkosatrio
Copy link

image

@Gummibeer
Copy link
Member

The issue is that there is an attribute and locale id. This was already discussed in
dimsav/laravel-translatable#546

Atm I have no good solution for it. And it's not on top of my own priorities because I don't need Indonesian.
But feel free to create a fix and open a PR.

The best solution I could think about would be a "conflicting attributes / locales" config. Which is used for a $attribute in $conflicting && $value is array check. Which would limit it to conflicting attributes which aren't an array/collection.

But feel free to find a better way if you want. 😉

@ikkosatrio
Copy link
Author

can you give me some example for "$attribute in $conflicting && $value is array check", and where i add that?
image

@Gummibeer
Copy link
Member

@ikkosatrio the simple fix to prevent trying to fill a translation with a non-array is in #38
I will release this later today.

@ikkosatrio
Copy link
Author

sorry, is that right? I change my code with the code below

Translatable
image

Model
image

Controller
image

@Gummibeer
Copy link
Member

If it's copied - but like I said this fix will be in an official release today.

@Gummibeer
Copy link
Member

Sorry for the delay - it's now released
https://github.com/Astrotomic/laravel-translatable/releases/tag/v11.1.3

@Gummibeer Gummibeer self-assigned this Aug 2, 2019
@ikkosatrio
Copy link
Author

thx for the update,but when i try it,
image
only save the "en" locale
image

@Gummibeer
Copy link
Member

Have you added id to the locales config?

@ikkosatrio
Copy link
Author

ya, i'm already add "id"
image

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

Successfully merging a pull request may close this issue.

2 participants