Commit 5adb136b authored by Fredric Mitchell's avatar Fredric Mitchell
Browse files

move taxonomy_index rebuild to published method

parent d3a17b17
......@@ -201,6 +201,14 @@ class StateFlow extends StateMachine {
// Update the node access table for this node.
$node = node_load($this->object->nid, $this->object->vid, TRUE);
node_access_acquire_grants($node);
//rebuild taxonomy index
if (function_exists('taxonomy_delete_node_index')) {
taxonomy_delete_node_index($node);
}
if (function_exists('taxonomy_build_node_index')) {
taxonomy_build_node_index($node);
}
}
public function set_unpublished() {
......
......@@ -175,11 +175,6 @@ function state_flow_node_insert($node) {
$state_flow = state_flow_load_state_machine($node);
$state_flow->persist();
$state_flow->write_history($user->uid);
if (module_exists('taxonomy')) {
if (function_exists('taxonomy_build_node_index')) {
taxonomy_build_node_index($node);
}
}
}
/**
......@@ -198,14 +193,6 @@ function state_flow_node_update($node) {
$state_flow->persist();
if (!empty($node->revision)) {
$state_flow->write_history($user->uid);
if (module_exists('taxonomy')) {
if (function_exists('taxonomy_delete_node_index')) {
taxonomy_delete_node_index($node);
}
if (function_exists('taxonomy_build_node_index')) {
taxonomy_build_node_index($node);
}
}
}
}
state_flow_prevent_live_revision($node);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment