While making a sub theme from twitter_bootstrap, Everything was running smoothly until, I checked my homepage I found this error: "Fatal error: Call to undefined function _twitter_bootstrap_local_tasks() in /sites/all/themes/twitter_bootstrap/template.php on line 178"

I checked the template.php in the twitter_bootstrap directory then I found that the _twitter_bootstrap_local_tasks() was not declared before or even after calling, So commenting the line makes everything work fine.

I don't know what this function for? But the line which the function is called in $variables['tabs']['#primary'] = _twitter_bootstrap_local_tasks($variables['tabs']['#primary']); as commented Replace tabs with drop down version.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

TomiMikola’s picture

I ran into the same problem. It is easy to fix. Simply apply this patch to the template.php file.

frankbaele’s picture

Assigned: Unassigned » frankbaele
Status: Active » Fixed
frankbaele’s picture

Status: Fixed » Closed (fixed)
kappaluppa’s picture

I've been trying to get a subtheme of twitter_bootstrap going (still to no avail, however), and I ran into that same issue. I found the function in twitter_bootstrap/includes/modules/menu.inc

I changed twitter_bootstrap to my theme name and the error went away.

/**
* Get all primary tasks including subsets
*/
function _twitter_bootstrap_local_tasks($tabs = FALSE) {
  if($tabs == '')
	return $tabs;
  
  if(!$tabs)
	$tabs = menu_primary_local_tasks();
  
  foreach($tabs as $key => $element) {
	$result = db_select('menu_router', NULL, array('fetch' => PDO::FETCH_ASSOC))
	  ->fields('menu_router')
	  ->condition('tab_parent', $element['#link']['path'])
	  ->condition('context', MENU_CONTEXT_INLINE, '<>')
	  ->condition('type', array(MENU_DEFAULT_LOCAL_TASK, MENU_LOCAL_TASK), 'IN')
	  ->orderBy('weight')
	  ->orderBy('title')
	  ->execute();
  
	$router_item = menu_get_item($element['#link']['path']);
	$map = $router_item['original_map'];
  
	$i = 0;
	foreach ($result as $item) {
	  _menu_translate($item, $map, TRUE);
  
	  //only add items that we have access to
	  if ($item['tab_parent'] && $item['access']) {
		//set path to that of parent for the first item
		if ($i === 0) {
		  $item['href'] = $item['tab_parent'];
		}
  
		if (current_path() == $item['href']) {
		  $tabs[$key][] = array(
			'#theme' => 'menu_local_task',
			'#link' => $item,
			'#active' => TRUE,
		  );
		}
		else {
		  $tabs[$key][] = array(
			'#theme' => 'menu_local_task',
			'#link' => $item,
		  );
		}
  
		//only count items we have access to.
		$i++;
	  }
	}
  }
  
  return $tabs;
}
andregriffin’s picture

Project: Twitter's Bootstrap » Bootstrap