Hello -

I've implemented Activity on my site (awesome mod!) and came across what seems to be a bug.

Under the user activity settings, I've enabled only "register" as I'd like to announce whenever someone new registers to the site, however so far all my test cases are announcing that "Anonymous" has joined. I'm using LoginToboggan for my registration handling, but I don't think that that has any effect. Could it just a timing issue between the announcement by activity and the state of the userID in the registration process? Is anyone else having this issue? (I attempted to search for this in the queue but drupal.org's search is a bit flakey with the reindexing).

Command used: Welcome our newest member, [author-all]!

Thanks!

Comments

sirkitree’s picture

Status: Active » Needs review
Issue tags: +activity-6.x-1-0-rc1
StatusFileSize
new699 bytes

Yeup, looks like there was a bug, should have been passing along the $account->uid instead of $user->uid. Try out this patch.

Apollo610’s picture

Awesome, looks good... thanks!!

sirkitree’s picture

Status: Needs review » Reviewed & tested by the community
jaydub’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new869 bytes

That will cause a problem when the $op of the hook_user implementation is 'view'. As in user ($user) is viewing the profile page of other user ($account).

In this case $account->uid would be the target of the 'view' and not the one initiating the activity so the activity record would show the wrong user.

The issue is that when the $op is 'insert', the $user object has no uid but the $account does. So I'm thinking that something like this patch would suffice.

NOTE: still testing this patch. should have waited before hitting save :)

Apollo610’s picture

I updated with the latest patch and will let you know how it looks when the next user registers. Thanks!

jaydub’s picture

StatusFileSize
new871 bytes

ok updated replacing author with account

sirkitree’s picture

StatusFileSize
new868 bytes

Ah, yes. I see what you mean. Thanks jaydub!

However there is no $author variable, it's $account.

sirkitree’s picture

lol.

sirkitree’s picture

Status: Needs review » Reviewed & tested by the community
Apollo610’s picture

Just wanted to let you guys know that last rolled patch (#7) was enabled on my site and tested and works great. Thanks again!

sirkitree’s picture

Status: Reviewed & tested by the community » Fixed

committed to dev.

Status: Fixed » Closed (fixed)
Issue tags: -activity-6.x-1-0-rc1

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