Active
Project:
Tracker 2
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
23 Jan 2010 at 17:09 UTC
Updated:
23 Jan 2010 at 17:25 UTC
During nodeapi for insert/update operations, _tracker2_add() is invoked to record tracker data, and here the {node} table is queries to obtain the node status. However, this is already available from the $node object passed to nodeapi, so this query is not really required in that case.
I think $node->status could be passed as an additional argument to _tracker2_add(), and perform the query against the {node} table, only when the $status argument is not passed.
Comments
Comment #1
markus_petrux commentedhmm... and the same logic could also be applied to _tracker2_remove(). When invoked from nodeapi('delete'), $node->status could be passed as an additional argument, and this could be used to avoid a query in _tracker2_remove() because when $status would be passed to _tracker2_remove() that means the node is being deleted, so there's no need to check if it exists.
[EDIT] In fact, during nodeapi('delete') there's no need to invoke _tracker2_remove() because the following is enough, I think:
So here we can save a query to the {node} table, and an invocation to _tracker2_remove(). :)