Virgin install. Schema run correctly, error on every insert

user warning: Field 'idx' doesn't have a default value query: INSERT INTO user_activity (uid, pis, logins, timestamp) VALUES (1, 1, 1, 1281723786) in C:\Domains\example.com\wwwroot\sites\all\modules\user_activity\user_activity.module on line 253.

Indeed no value defined in insert and no default value set on table.

function user_activity_set($user) {
  return db_query("INSERT INTO {user_activity} (uid, pis, logins, timestamp) VALUES (%d, 1, 1, %d)", $user->uid, time());
}

Not sure if the insert should have a value or the column should have a default value?

Tried the development version - new error

PHP Warning: Call-time pass-by-reference has been deprecated; If you would like to pass it by reference, modify the declaration of [runtime function name](). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file in C:\Domains\example.com\wwwroot\sites\all\modules\user_activity\user_activity.module on line 322 

line 322

  // Allow altering the index by other modules implementing hook_user_activity_index_alter(&$activity_index)
  drupal_alter('user_activity_index', &$activity_index);

Comments

PostHistory’s picture

Hi I came across this issue just now, fixed it too... here is what i did
Original

<?php
function user_activity_set($user) {
   return db_query("INSERT INTO {user_activity} (uid, pis, logins, timestamp) VALUES (%d, 1, 1, %d)", $user->uid, time());
 }
?>

New

<?php
function user_activity_set($user) {
  return db_query("INSERT INTO {user_activity} (uid, pis, logins, idx, timestamp) VALUES (%d, 1, 1, 30, %d)", $user->uid, time());
}
?>

So I just added idx between logins and timestamp and then for the values i added the number 30. this will give the user an activity rating of 30% to start with. hope this helps someone who comes across this issue in the future.

not up on how to make a patch for this otherwise i would have.