1) I created User via twitter.
2) Delete this user.
3) Want to create the same user via twitter again.
I get this errors:
•user warning: Duplicate entry '' for key 2 query: INSERT INTO users (created) VALUES (1272111815) in /drupal/modules/user/user.module on line 327.
•warning: array_fill() [function.array-fill]: Number of elements must be positive in /drupal/includes/database.inc on line 253.
•warning: implode() [function.implode]: Invalid arguments passed in /drupal/includes/database.inc on line 253.
•warning: array_keys() [function.array-keys]: The first argument should be an array in /drupal/modules/user/user.module on line 502.
•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 role r INNER JOIN permission p ON p.rid = r.rid WHERE r.rid IN () in /www/htdocs/w00a4e9f/drupal/modules/user/user.module on line 502.

Comments

uniqode’s picture

I have exactly the same error

uniqode’s picture

I found the problem if you delete a user it still keep user twitter account. So you need to delete user's twitter accounts from twitter_account table

Anonymous’s picture

Status: Active » Closed (fixed)

Tried this in the latest dev branch and it seems solved there. Dunno what the best practice is for these situations but ill close the issue. Reopen it if that is stupid. xD

tstackhouse’s picture

Reopening this, it is still a bug in beta3, the module needs to implement hook_user('delete') and delete entries from the table.

Osiris Indriya’s picture

Version: 6.x-3.0-beta2 » 6.x-3.0-beta3
Status: Closed (fixed) » Active

Subscribing...

I have the same error. I added the same Twitter account to two users, removed it from one, but I now get this error intermittently.

steinmb’s picture

Version: 6.x-3.0-beta3 » 6.x-3.0-beta9
Status: Active » Fixed

Unable to reproduce in the latest 6.x-3 version, fixed?

Status: Fixed » Closed (fixed)

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

L1maniac’s picture

i have this problem too, what is the solution?!

steinmb’s picture

@L1maniac: Hi :) What version are you on and how do you reproduce it?

hedac’s picture

I didn't delete the user but I have same errors visiting user page
using 6.x-3.0-beta9

  • 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 role r INNER JOIN permission p ON p.rid = r.rid WHERE r.rid IN () in /drupal/modules/user/user.module on line 528.
  • array_keys() expects parameter 1 to be array, null given in /drupal/modules/user/user.module on line 528.
  • implode(): Invalid arguments passed in /drupal/includes/database.inc on line 253.
  • array_fill(): Number of elements must be positive in /drupal/includes/database.inc on line 253.
mtem27’s picture

Hi!

What's the correct fix for this? This issue still exists on the 6.x-3.0-beta9 version (Recommended Release)

I tried this http://drupal.org/node/911646, but got an error with duplicate twitter_user_delete function.

While this, http://drupal.org/node/1614488, is the same as the above's function.

There is a twitter_user_delete in twitter.inc for 6.x-3.0-beta9 but is not firing.

Any help is appreciated.

Thanks.

mtem27’s picture

Status: Closed (fixed) » Active
vb_swapnil’s picture

Hello ,
After setting Twitter username in drupal user account i got following error.

Notice: Undefined property: stdClass::$data in Twitter->request() (line 210 of /home/infogrid/workspace/acquia-drupal/sites/all/modules/twitter/twitter.lib.php).
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'twitter_uid' cannot be null: INSERT INTO {twitter_account} (twitter_uid, screen_name, name, location, description, followers_count, friends_count, statuses_count, favourites_count, url, protected, profile_image_url, profile_background_color, profile_text_color, profile_link_color, profile_sidebar_fill_color, profile_sidebar_border_color, profile_background_image_url, profile_background_tile, verified, created_at, created_time, utc_offset, oauth_token, oauth_token_secret, uid) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9, :db_insert_placeholder_10, :db_insert_placeholder_11, :db_insert_placeholder_12, :db_insert_placeholder_13, :db_insert_placeholder_14, :db_insert_placeholder_15, :db_insert_placeholder_16, :db_insert_placeholder_17, :db_insert_placeholder_18, :db_insert_placeholder_19, :db_insert_placeholder_20, :db_insert_placeholder_21, :db_insert_placeholder_22, :db_insert_placeholder_23, :db_insert_placeholder_24, :db_insert_placeholder_25); Array ( [:db_insert_placeholder_0] => [:db_insert_placeholder_1] => [:db_insert_placeholder_2] => [:db_insert_placeholder_3] => [:db_insert_placeholder_4] => [:db_insert_placeholder_5] => [:db_insert_placeholder_6] => [:db_insert_placeholder_7] => [:db_insert_placeholder_8] => [:db_insert_placeholder_9] => [:db_insert_placeholder_10] => [:db_insert_placeholder_11] => [:db_insert_placeholder_12] => [:db_insert_placeholder_13] => [:db_insert_placeholder_14] => [:db_insert_placeholder_15] => [:db_insert_placeholder_16] => [:db_insert_placeholder_17] => [:db_insert_placeholder_18] => [:db_insert_placeholder_19] => [:db_insert_placeholder_20] => [:db_insert_placeholder_21] => [:db_insert_placeholder_22] => 0 [:db_insert_placeholder_23] => [:db_insert_placeholder_24] => [:db_insert_placeholder_25] => 1 ) in twitter_account_save() (line 56 of /home/infogrid/workspace/acquia-drupal/sites/all/modules/twitter/twitter.inc).
Please need help here to resolve above error

mtem27’s picture

Per my #11 post above, I came up with a custom module using hook_user. To anyone who wanted to check, below is the code:

function mymodule_user($op, &$edit, &$account, $category = NULL) {
  module_load_include('inc', 'twitter');
  if ($op == 'delete') {
    // loop through the selected users from the admin list
    foreach ($edit['accounts'] as $key => $val) {
      // get twitter_uid via uid
      $q = db_fetch_array(db_query("SELECT * FROM {twitter_account} WHERE uid = %d", $val));
      $twitterid = $q['twitter_uid'];
      // pass on twitter_uid to the delete function
      twitter_user_delete($twitterid);  
    }
  }
}

Thanks.

tcibah’s picture

Have the same problem and it fires from the moment Twitter module is enabled, with no Twitter user accounts yet.

It generates tons of error messages in the Watchdog...

tcibah’s picture

Problem fixed by using the latest development version: twitter-6.x-3.x-dev.tar.gz

Do not forget to clear cache, otherwise an error message in a white scree will popup.

Thanks juampy...

juampynr’s picture

Status: Active » Fixed

Marking it as fixed.

Status: Fixed » Closed (fixed)

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