I've created an action to know when a profil is updated.

When this action is executed 2 fields are created into the activity_messages table and into the activity_targets table (that's ok). When I look into Activity table I've got my record but my Uid is always to 0

45 | 0 | update | user | NULL | 1254298815

Do you have any idea ?

Best regards

Comments

sirkitree’s picture

Status: Active » Postponed (maintainer needs more info)

Do you also have an activity template setup for this?

JulienD’s picture

Yes I have built an activity template :

Activity publisher templates > create > user > (I checked update and my user) > wrote my descriptions > Save

Scott Reynolds’s picture

I haven't look at this problem, but the function the problem resides in is activity_record. And it deals with its drupal_write_record() to the activity table.

There it does some handling to determine if it should use global $user or not. I believe that handling is flawed.

Scott Reynolds’s picture

Status: Postponed (maintainer needs more info) » Active

Setting active status

Scott Reynolds’s picture

Priority: Normal » Minor

Minor priority as the activity messages still work I believe.

Scott Reynolds’s picture

Status: Active » Postponed (maintainer needs more info)

Couldn't get this to happen.

Have you tried the latest Activity2?

Scott Reynolds’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

No more information provided in months and I couldn't reproduce.

ermannob’s picture

Status: Closed (fixed) » Needs review

Hi,
I looked into this issue, as I need to log exactly which user viewed certain nodes.
I'm not sure if my modification will make Activity work as intended, but for my needs it's ok.

activity.module:512
change
$record->uid = (!empty($context[$type]->uid)) ? $context[$type]->uid : $user->uid;
to
$record->uid = (empty($context[$type]->uid)) ? $context[$type]->uid : $user->uid;

ermannob’s picture

Uhm.... Sorry, my code doesn't make sense...
More likely:
$record->uid = (!empty($user->uid)) ? $user->uid : $context[$type]->uid;

Scott Reynolds’s picture

Status: Needs review » Closed (fixed)

Please open a separate issue as it is unrelated. In this case, the original user couldn't get a uid to record.

In your case, you want a different uid to be recorded.