I get this error when I pull up a page with facebook status page on my site?
warning: array_unique() [function.array-unique]: The argument should be an array in /var/www/vhosts/mysite.com/httpdocs/drupal/sites/all/modules/facebook_status/facebook_status.module on line 1001.
any ideas on what is going on?
Thanks.
Comments
Comment #1
icecreamyou commentedWhat version and type of SQL are you using?
Anyway, this shouldn't happen on any page, just with pages that have the FBS UR block.
Comment #2
socialnicheguru commentedMySQL database 5.0.22
MySQL database for event module 5.0.22
PHP 5.2.6
PHP register globals Disabled
SimpleXML library. Available
A fast XML parsing library. (From PHP5)
Unicode library PHP Mbstring Extension
Web server Apache/2.2.3 (CentOS)
jQuery UI 1.5.2
jQuery Update Installed correctly
Comment #3
icecreamyou commentedHmm. I would have expected MySQL 4.x. Is your site on a subdomain? Do you have User Relationships installed? Is this error in the logs or is it a WSOD? Which blocks are you looking at and what are the FBS permissions of the users looking at them that cause these errors?
Comment #4
socialnicheguru commentedit is in a subdirectory.
i do have user relationships installed
it is not wsod, but an onscreen error
i have just installed to test. it is for admin, user 1
; Information added by drupal.org packaging script on 2009-01-15
version = "5.x-2.x-dev"
project = "user_relationships"
datestamp = "1231978884"
Comment #5
icecreamyou commentedThe likely culprit for this type of issue is a spelling error in a variable, but as far as I can tell there aren't any spelling errors in the relevant locations. Perhaps try removing the comment on line 1001, or looking around there to see if you notice any mismatched variable names that I didn't. Otherwise, I have no idea, and I would expect to have seen a lot more people with this error if I this was the case.
Comment #6
socialnicheguru commentedI just tried to test (albeit I am not a programmer but i can throw in a few print statements to see what is going on. Hopefully this diagnostic will help).
I put this in the code to see what was going on:
the out put was:
$user_rel isResource id #3964
$row is
$user_rel isResource id #3966
$row is
$user_rel isResource id #3968
$row is
$user_rel isResource id #3970
$row is
$uid_list is
It doesn't seem that $row is defined (but that could be my lack of knowledge of db_fetch_array if it is given a resource id).
http://api.drupal.org/api/function/db_fetch_array/6
It doesn't look like the while loop is being executed. Then what is passed into array_unique is not an array because it has not been defined.
Comment #7
socialnicheguru commentedI also notice that I have Facebook Status UR Recent Updates block and other blocks enabled. The UR Recent Updates block show my own status updates. I bring this up, because in the code around line 1001 ie the while loop above, it says that it wants to exclude the current signed in user.
I am the admin and have not created any user relationships yet.
Comment #8
socialnicheguru commentedLastly, when I do try to run the status, I do get the status update (with additional unexpected updated as in #7). I also get these errors:
Hi when I implemented a status update, I got the following errors.
I include the activity module errors because I think has something to do with facebook_status interaction with activity module. I am running activity 5.x-4.x-dev, which they suggest.
* warning: Missing argument 6 for activity_insert(), called in /var/www/vhosts/beta.activelyOUT.com/httpdocs/drupal/sites/all/modules/facebook_status/facebook_status.module on line 1117 and defined in /var/www/vhosts/beta.com/httpdocs/drupal/sites/all/modules/activity/activity.module on line 391.
* warning: mysql_real_escape_string() expects parameter 1 to be string, array given in /var/www/vhosts/beta.com/httpdocs/drupal/includes/database.mysql.inc on line 402.
* warning: mysql_real_escape_string() expects parameter 1 to be string, array given in /var/www/vhosts/beta.com/httpdocs/drupal/includes/database.mysql.inc on line 402.
* warning: Invalid argument supplied for foreach() in /var/www/vhosts/beta.com/httpdocs/drupal/sites/all/modules/activity/activity.module on line 403.
* warning: array_unique() [function.array-unique]: The argument should be an array in /var/www/vhosts/beta.com/httpdocs/drupal/sites/all/modules/facebook_status/facebook_status.module on line 1001.
I hope I am being helpful in trying to point out some items and trying to do limited testing so you don't have too.
C
Comment #9
icecreamyou commentedThank you for trying to debug. First and foremost, the project page says:
So, don't use Activity 4.x. I've had a couple of these reports; I should probably just add an error to the module if I can figure out a way to detect what Activity version is being used...
Second, you're getting the error because you don't have any relationships. If you don't have any relationships, the FBS UR block will show your latest status instead. I think all you need to do to fix this error is add this line after line 964:
The problem was that $uid_list was not initiated as an array before it was run through array_unique() unless the relevant user had relationships already.
For future reference, with regards to the code you used to test:
Comment #10
icecreamyou commentedI think this is fixed locally. It will be in the next release. Please reopen the issue if it is not fixed.