Team forum insert hook

Fixed hook to add entry to mapping table on team_forum node insert. The UID must be from the node, not the current user, in case the node is being created by a third party (i.e. during import)

(DBOINCP-59)
This commit is contained in:
Tristan Olive 2014-02-18 02:23:33 -05:00
parent e6e573da2d
commit 80efeb28fe
1 changed files with 1 additions and 2 deletions

View File

@ -86,8 +86,7 @@ function boincteam_forum_nodeapi(&$node, $op, $a3 = null, $a4 = null) {
function boincteam_forum_node_insert($node) {
switch($node->type) {
case 'team_forum':
global $user;
$account = user_load($user->uid);
$account = user_load($node->uid);
$team_id = boincteam_forum_lookup_nid($node->tfid);
if ($account->team == $team_id) {
db_query("