Problem/Motivation
In tracker,module, function _tracker_remove() performs the same database update to table tracker_node twice.
// And then we push the out the new changed timestamp to our denormalized
// tables.
$connection->update('tracker_node')
->fields([
'changed' => $changed,
'published' => $node->isPublished(),
])
->condition('nid', $nid)
->execute();
$connection->update('tracker_node')
->fields([
'changed' => $changed,
'published' => $node->isPublished(),
])
->condition('nid', $nid)
->execute();
I believe the second update should be made to table tracker_user instead. That's the pattern we see in the next few lines of code:
else {
// If the node doesn't exist, remove everything.
$connection->delete('tracker_node')
->condition('nid', $nid)
->execute();
$connection->delete('tracker_user')
->condition('nid', $nid)
->execute();
}
Comments
Comment #2
mradamjohn commentedLooks reasonable to me, David.
Great catch.
Will need to be reviewed/tested..
Comment #3
avpadernoComment #4
avpadernoComment #5
juancec commentedI'll work on it.
Comment #6
juancec commentedPlease kindly review it.
Comment #7
avpadernoI checked the tracker.module file. That is the only case where the same database table is updated twice.
Comment #10
batigolix