I'm getting the following warning on every page:
Warning: in_array() expects parameter 2 to be array, string given in fboauth_user_permissions() (line 365 of .../fboauth.fboauth.inc).
It's coming from a call I'm making to fboauth_action_display('connect') . And it's resulting from fboauth_user_permissions() receiving an argument that evaluates to the empty string, and therefore doesn't get caught as not set. I'm not sure how this is happening.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | fboauth-profile_var-1638404-1.patch | 659 bytes | goron |
Comments
Comment #1
goron commentedOk. This was a not-very-telling warning that was coming from a simple problem.
I have the profile module enabled, but no profile fields set up. This results in the following code saving a NULL value for the variable fboauth_user_profile, since in this case $form_state['values']['fboauth_user_profile'] is undefined:
This actually also results in an undefined index error when the form is saved, but I didn't notice it because I never saved that form on this site. I actually exported that variable to a feature using strongarm on another site and enabled that feature on this site. Strongarm exported the variable as the empty string, which led to the error mentioned in the first post.
The actual problem is that the submit callback doesn't check if any value actually exists for ['fboauth_user_profile']. Patch below fixes that.
Comment #2
silverbell commentedThanks @goron. This patch fixed the error message on my site.
Comment #3
quicksketchThankg guys! I fixed this with an identical patch in #1621120: Error when saving configuration: "array_filter() first argument should be an array" when no profile fields available.