Hey Ice,

I upgraded one version of a site with FB from beta to RC1 with no problems but just upgrading another one and I got the following whenever I try to submit a status:

    * warning: array_shift() [function.array-shift]: The argument should be an array in /var/www/lc3/sites/all/modules/facebook_status/facebook_status.module on line 1012.
    * warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, '' was given in /var/www/lc3/includes/form.inc on line 366.

The facebook_status form I'm using is in conjunction with a facebook_status view and ahah callback within a user profile panel.

Comments

pribeh’s picture

Disabled and re-enabled the module and the warning disappears so far.

icecreamyou’s picture

Category: bug » support
Status: Active » Fixed

I'm pretty sure that's due to leftover cache data from before the upgrade. Disabling (and re-enabling) a module refreshes your site's cache, which would have fixed the problem. You may have forgotten to run update.php or a cache may just not have flushed completely while update.php was running.

pribeh’s picture

I'm pretty sure that my flush cache didn't entirely flush the cache since I do run update and cache after every update. I've noticed that happening from time to time.

icecreamyou’s picture

Yeah, that could be. I don't know for sure but I've heard that the functions that supposedly flush the cache in D6 don't actually flush all the caches, although I was under the impression that all the caches were flushed during update.php.

pribeh’s picture

Status: Fixed » Active

sorry for opening this again but I'm getting the error again this time no matter what I do:

    * warning: array_shift() [function.array-shift]: The argument should be an array in /var/www/thomas/lc3/sites/all/modules/facebook_status/facebook_status.module on line 1012.
    * warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, '' was given in /var/www/thomas/lc3/includes/form.inc on line 366.
pribeh’s picture

it actually appears to be a conflict with the mobile tools module. As soon as I turn it off the error goes away. will investigate.

icecreamyou’s picture

Well, it's technically easy to fix, but the line in question (below) should always work, at least with Drupal core. It may be that the Mobile Tools module modifies $form['#parameters'] but I'd be surprised if it removed it altogether (the likely cause) or changed it to a different type of variable (less likely).

  $args = $form['#parameters'];
  $form_id = array_shift($args);

If this is indeed a bug (which I do not believe it is), the solution is to use this code instead of the above two lines:

  $args = $form['#parameters'];
  $form_id = '_facebook_status_status';
  if (is_array($args)) {
    $form_id = array_shift($args);
  }

I don't have time to look into what the Mobile Tools module does, but if that is the culprit, this is not a bug in FBSS.

icecreamyou’s picture

Status: Active » Postponed (maintainer needs more info)
pribeh’s picture

Thanks for the help Ice. I filed an issue in the Mobile Tools module support q.

I tried the code you mentioned above and the error disappears but so does the facebook_status view after posting a status update.

icecreamyou’s picture

Status: Postponed (maintainer needs more info) » Fixed

I'm 97% sure attached views have nothing to do with that line, but it's something of an unsupported hack anyway.

I suppose this issue isn't really "fixed," but there's nothing else I can contribute to it, so marking as "fixed" anyway.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

pribeh’s picture

Hi, sorry to bring this issue up again. I'm running Mobile Tools 1.7, Facebook Status without any ahah, just a page refresh upon submission and still get a bug with status updates. Instead of getting the reported error I get a negative character indicator (the "NaN") on the Facebook Status form after submission of a status. If you simply have an idea of what might be interfering I'll report this back to the Mobile Tools maintainer. Thanks so much Ice.

icecreamyou’s picture

My answer is essentially the same as here (a search would have revealed that...). Essentially, the FBSS JavaScript only works if only one instance of the status update form appears on the page. I don't know what Mobile Tools does, but it may be that it tries to load other instances of the form in the background that are confusing the FBSS JavaScript.

pribeh’s picture

Sorry Ice. I'll send this over to the maintainer of Mobile Tools. Thanks!