Hi All, Im fairly new to php etc and I have installed the linked in integration module and followed all the steps. Im having a problem with the 'Login using linkedIn' button in the login box. I keep getting the following message. Im using Drupal 6.:

Hi, I'm also having this error message:

* warning: array_fill() [function.array-fill]: Number of elements must be positive in /home2/cmtwoleg/public_html/includes/database.inc on line 253.
* warning: implode() [function.implode]: Invalid arguments passed in /home2/cmtwoleg/public_html/includes/database.inc on line 253.
* warning: array_keys() [function.array-keys]: The first argument should be an array in /home2/cmtwoleg/public_html/modules/user/user.module on line 513.
* user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1 query: SELECT p.perm FROM drp_role r INNER JOIN drp_permission p ON p.rid = r.rid WHERE r.rid IN () in /home2/cmtwoleg/public_html/modules/user/user.module on line 513.

Any advice or tips would be greatly appreciated.

Thanks,
Conor

Comments

smanes’s picture

This is usually caused by a broken call to user_access() in Drupal's user.module. I spent the better part of an evening tracing this problem down in Forum Access, which turned out not to be Forum Access' problem at all but a module which was accessing its local callback function with a bad argument. That argument (in my case the literal string "access content") was being passed to a function expecting a 'user' object, which is what started this chain of warnings.

Best thing to do is install the Devel module and enable 'backtrace'. It might not show you the source of the problem, especially if it's inside a callback, but it will show you where you can start your repair job.

In my case, I changed a chunk of code from this:

 if (!isset($account) ) {
    $account = $user;
 }

to this:

  if (!isset($account) ) {
    $account = $user;
  }
  if (!is_object($account)) {   // PATCH SHM
     return FALSE;
  }

The additional check for argument type prevented user_access() from receiving a bad argument.

greg.harvey’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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