diff --git a/core/modules/forum/forum.module b/core/modules/forum/forum.module index 7e2dabd..79bd696 100644 --- a/core/modules/forum/forum.module +++ b/core/modules/forum/forum.module @@ -1214,9 +1214,9 @@ function _forum_user_last_visit($nid) { $history = &drupal_static(__FUNCTION__, array()); if (empty($history)) { - $result = db_query('SELECT nid, timestamp FROM {history} WHERE uid = :uid', array(':uid' => $user->uid)); + $result = db_query("SELECT entity_id, timestamp FROM {history} WHERE uid = :uid AND entity_type = 'node'", array(':uid' => $user->uid)); foreach ($result as $t) { - $history[$t->nid] = $t->timestamp > HISTORY_READ_LIMIT ? $t->timestamp : HISTORY_READ_LIMIT; + $history[$t->entity_id] = $t->timestamp > HISTORY_READ_LIMIT ? $t->timestamp : HISTORY_READ_LIMIT; } } return isset($history[$nid]) ? $history[$nid] : HISTORY_READ_LIMIT;