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 |
Jump to:
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.)
| Attachment | Size |
|---|---|
| activity_time_limit_fix.patch | 960 bytes |

#1
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
#3
Will test.
#4
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
Any news on the patch? My activity streams are full of duplicate actions.
#6
5.x unsupported please see 6.x-2
#7
same problem in 6.x-1.2