I'm getthing the following error when I run drush cron...

WD cron: PDOException: SQLSTATE[HY000]: General error: 1364 Field 'uid' doesn't have a default value: INSERT INTO {twitter_account}  [error]
(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)
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); Array
(
    [:db_insert_placeholder_0] => 30587206
    [:db_insert_placeholder_1] => rlnorthcutt
    [:db_insert_placeholder_2] => Ron Northcutt
    [:db_insert_placeholder_3] => Austin, TX
    [:db_insert_placeholder_4] => 
    [:db_insert_placeholder_5] => 114
    [:db_insert_placeholder_6] => 186
    [:db_insert_placeholder_7] => 4307
    [:db_insert_placeholder_8] => 11
    [:db_insert_placeholder_9] => http://t.co/Meq59KULcI
    [:db_insert_placeholder_10] => 0
    [:db_insert_placeholder_11] => http://a0.twimg.com/profile_images/1192776077/49936_559179665_2480272_q_normal.jpg
    [:db_insert_placeholder_12] => B2DFDA
    [:db_insert_placeholder_13] => 333333
    [:db_insert_placeholder_14] => 93A644
    [:db_insert_placeholder_15] => FFFFFF
    [:db_insert_placeholder_16] => EEEEEE
    [:db_insert_placeholder_17] => http://a0.twimg.com/images/themes/theme13/bg.gif
    [:db_insert_placeholder_18] => 0
    [:db_insert_placeholder_19] => 0
    [:db_insert_placeholder_20] => Sun Apr 12 02:58:55 +0000 2009
    [:db_insert_placeholder_21] => 1239505135
    [:db_insert_placeholder_22] => -21600
)
 in twitter_account_save() (line 62 of sites/all/modules/twitter/twitter.inc).

Comments

generalredneck’s picture

Looks like it only happens if I have mentions turned on...

Note my user is the only user on the site...

johnpicozzi’s picture

I'm having a similar problem when adding a Twitter account.

generalredneck’s picture

Do you have any specifics? like steps to reproduce. I'm assuming you are enabling mentions as well and it most likely fails trying to grab the twitter-user-who-mentioned-you's info. I may be able to do something in the code...

My biggest beef with fixing this issue is I don't know what all is being done with the twitter_accounts. I would love to just assign the uid of 0 to any user that doesn't exist on the site, but I'm sure we would then have to add a hook on user creation to check to see if one of these accounts is one that has been downloaded from twitter before... with God knows what else.

In short... not familiar enough with the code and this one is a bit too big. Lastly the issue isn't affecting me enough (selfish I know). Other issues with other modules are higher on my priority list.

johnpicozzi’s picture

Steps to reproduce...

  1. Install modules (twitter & Oauth)
  2. Add app to Twitter dev and add keys to drupal
  3. Go to logged in users account page and click twitter button to add account
  4. get directed to Twitter to confirm access. Agree and get redirected back to drupal
  5. Get error message from above and no twitter account is added to the site

Hope this helps, Let me know if you need more clarification.

apratt’s picture

Indeed turning mentions off solved this problem for me.

Angus

xurizaemon’s picture

Title: cron throws PDOException » PDOException in import when importing mentions (no default value for {twitter.uid})
Version: 7.x-5.8 » 7.x-5.x-dev
Status: Active » Needs work

For sites which import mentions, we need to permit some default value (ie NULL) in {twitter.uid}.

jamiehollern’s picture

Status: Needs work » Needs review
StatusFileSize
new947 bytes

I've thrown together a quick patch that would update the twitter_account.uid column to accept NULL values.

damienmckenna’s picture

Status: Needs review » Needs work

Triggering the testbot.

damienmckenna’s picture

Status: Needs work » Needs review

Triggering the testbot.

Status: Needs review » Needs work

The last submitted patch, 7: make_twitter_account_uid_allow_null-2040901-7.patch, failed testing.

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 7: make_twitter_account_uid_allow_null-2040901-7.patch, failed testing.

damienmckenna’s picture

Status: Needs work » Needs review
StatusFileSize
new918 bytes

Rerolled.

damienmckenna’s picture

Version: 7.x-5.x-dev » 6.x-5.x-dev
StatusFileSize
new895 bytes

Backported to the 6.x-5.x branch.

damienmckenna’s picture

Ported to the 7.x-6.x branch.

damienmckenna’s picture

Status: Needs review » Fixed

Committed. Thanks!

Status: Fixed » Closed (fixed)

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