I am having a very strange problem with drupal. I have a custom module that does a goto if you view a node of a certain type (see code below). The problem is, after a while I get in an infinite loop where the datafile_flow_node_view is called infinitely (happens on every page,also the ones that don't contain the CT).
The most interesting part is (altough I don't use the search anywhere) that the view mode is search_index. After I disable the search module, the problem dissapears. When I reanable the module, the problem is gone for a certain time, then it returns (I don't know when and why).
Can anyone shed some light on why this happens ?
function datafile_flow_node_view($node, $view_mode, $langcode) {
if ($node->type == 'datafile') {
drupal_goto('node/' . $node->nid . '/edit');
}
}
@EDIT apparently this happens during running the cron. Is there a way to avoid the hook_node_views from beeing executed during cron ?