array_filter(): Argument #1 ($array) must be of type array, int given #339
-
Hello, It give me this error when I want to access other fields except the first one (works perfectly) |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
Hello. Could you please share the whole error message? Include de line and document where it's happening. |
Beta Was this translation helpful? Give feedback.
-
Your problem is that here the It's not the problem with the amount of fields you're translating, but with the value you're getting from one of the fields in the array. Since the problem happens when getting the translation, and since
Good coding! |
Beta Was this translation helpful? Give feedback.
-
Hello
in two last cases we got error
cause json_decode returns number, not null getAttributes() method is returning an string with number (last case in my example) 1 works fine Thank you! |
Beta Was this translation helpful? Give feedback.
Your problem is that here the
getAttributes()
method is returning an integer.It's not the problem with the amount of fields you're translating, but with the value you're getting from one of the fields in the array.
Since the problem happens when getting the translation, and since
name
works, I assume the problem is one of the other 3 fields, which is not returning an string, or the translation doesn't exist.