Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
node system
Priority:
Minor
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
16 Feb 2008 at 15:49 UTC
Updated:
11 Jul 2008 at 17:19 UTC
function node_types_rebuild() {
_node_types_build();
$node_types = node_get_types('types', NULL, TRUE);
foreach ($node_types as $type => $info) {
if (!empty($info->is_new)) {
node_type_save($info);
}
if (!empty($info->disabled)) {
node_type_delete($info->type);
}
}
_node_types_build();
}
That very first _node_types_build() seems redundant, since that function gets called within node_get_types since $reset = true. We may be doing an extra database query. Is there something else going on that I'm overlooking?
Comments
Comment #1
mot commentedGood question. For optimization Issues this needs further analysis. You write "maybe doing an extra database query". Maybe-Queries do cost no resources. Until it is a maybe-query only and not a real one, this can be closed.