Activity time limiter not working

remi - January 29, 2009 - 15:27
Project:Activity
Version:6.x-1.2
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

The activity time limiter mentioned in the module's settings page is not functional. Despite choosing any time limit, the module will still record and display all activity, even duplicate entries.

The problem is in activity_insert(), where a check is attempted on an integer from a column that doesn't exist.

Attached is a patch to fix this problem.

(Note this is a problem in version 5.x-3.0-beta2 and may have already been fixed in the development version.)

AttachmentSize
activity_time_limit_fix.patch960 bytes

#1

jaydub - February 20, 2009 - 07:48

The current code should work without requiring the COUNT(*) function needing an alias.

What version of PHP are you using?

You can add in this as a test:

function activity_insert($uid, $module, $type, $operation, $data, $target_users_roles) {
  // check time limit, ignore activity if within the limit
  $result = db_query("SELECT COUNT(*) FROM {activity} WHERE uid = %d AND module = '%s' AND type = '%s' AND operation = '%s' AND data = '%s' AND created >= %d", $uid, $module, $type, $operation, serialize($data), (time() - variable_get('activity_time_limit', 30)));

  // Debug test
  var_dump(db_fetch_object($result));

  if (db_fetch_object($result)->count != 0) {
    return FALSE;
  }

You should see the PHP debug dump for the query object with a single object attribute of 'count' with a numeric value.

Can you do this and return the result here along with the details of your setup?

#2

sirkitree - February 21, 2009 - 21:45
Status:active» postponed (maintainer needs more info)

#3

minesota - March 7, 2009 - 23:37

Will test.

#4

remi - March 9, 2009 - 15:12

I'm sorry I didn't reply sooner. I was working with the Activity module on a project that has been completed since a while now. I'll wait for minesota's results and see if I can test it afterwards.

#5

plan9 - August 19, 2009 - 14:30

Any news on the patch? My activity streams are full of duplicate actions.

#6

sirkitree - November 4, 2009 - 05:46
Status:postponed (maintainer needs more info)» won't fix

5.x unsupported please see 6.x-2

#7

j0sh - November 5, 2009 - 09:23
Version:5.x-3.0-beta2» 6.x-1.2
Status:won't fix» active

same problem in 6.x-1.2

 
 

Drupal is a registered trademark of Dries Buytaert.