For some reason clickpath_exit() hook isn't called, so I have to call it explicitly from clickpath_preprocess_page().

It works, but I wonder why? clickpath_exit() is called only once after enabling the module.

Comments

alexbk66-’s picture

Title: clickpath_exit doesn't call » clickpath_exit - $_SESSION['clickpath'] doesn't get updated

Actually, clickpath_exit() is called (I was using dsm which doesn't work when you leave the page).
But still, $_SESSION['clickpath'] doesn't get updated, I couldn't find why?
And if nobody else is having this problem, must be some other module is screwing it.

alexbk66-’s picture

Probably related issue #755804: Not working - $_SESSION flushed at every page
As a workaround I call clickpath_save_path from() clickpath_preprocess_page()

function clickpath_preprocess_page(&$variables) {
  if (variable_get('clickpath_breadcrumb', FALSE)) {
    $list = array();
    $links = clickpath_get_paths();
    foreach ($links as $path => $title) {
      $list[] = l(_clickpath_truncate_title($title), $path, array('html' => TRUE));
    }
    drupal_set_breadcrumb($list);
    $variables['breadcrumb'] = theme('breadcrumb', $list);
  }
  // Hook exit doesn't work, so call it here
  if (function_exists('drupal_get_path_alias')) {
    clickpath_save_path($_GET['q']);
  }
}