Active
Project:
Boost
Version:
6.x-1.x-dev
Component:
Voting API
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Anonymous (not verified)
Created:
16 Jun 2011 at 22:41 UTC
Updated:
3 Sep 2019 at 10:52 UTC
If boost_votingapi_insert is called but the voted item is a comment rather than a node, then a PHP error may occur. From line 1652 of boost.module:
function boost_votingapi_insert($votes) {
if (!variable_get('boost_enabled', CACHE_NORMAL)) return;
foreach ($votes as $vote) {
$node = node_load($vote['content_id'], NULL, TRUE);
boost_expire_node($node, $vote['content_id']);
}
}
For example if the vote is applied to a comment(cid=25) of a node (nid=480), then the $vote['content_id'] is 25. The following calls to node_load and boost_expire_node are now incorrectly using the cid as an nid, rather than first finding the parent node that was commented upon (and its nid). As a result, the cache on the wrong node is expired and if the node doesn't actually exist, then a PHP error occurs.