On pages configured to ignore URLs, I was seeing no primary tabs rendered at all. In breaking out the page preprocessing into its own function, the check against the 'URLs to ignore' was being ignored. This resulted in the primary tabs being removed in the page preprocess function for all pages. Checking whether the $tabs variable is empty as a condition for unsetting the primary tabs fixed this issue for me.

At the end of the file contextual_tabs.module, insert an if statement like below.

<?php
function contextual_tabs_preprocess_page(&$variables) {
  $tabs = contextual_tabs_render();
  if (!empty($tabs)) {
  	unset($variables['tabs']['#primary']);
  }
  $variables['primarytabs'] = $tabs;
}

?>

I have never created a patch file, so the attached file may or may not apply correctly.

Comments

jlholmes created an issue. See original summary.

zoursman’s picture

I got the same problem, your patch is working fine, Thx.

wizonesolutions’s picture

Version: 7.x-1.0-beta6 » 7.x-1.x-dev
Priority: Normal » Major
Status: Active » Reviewed & tested by the community

Upgrading to Major since this breaks *all* primary tabs unconditionally on all Open Atrium installations.

The patch works!

mpotter’s picture

Priority: Major » Normal

Well, it doesn't break all primary tabs in all Open Atrium installations because this didn't show up on any of our existing sites nor on new sites. It only happens on pages set to ignore URLs where there are additional preprocess functions.

But the patch is still reasonable and I'll get it into the next release of Atrium.

  • mpotter committed 9a5a725 on 7.x-1.x authored by jlholmes
    Issue #2698095 by jlholmes: No tabs even when set in 'URLs to ignore'
    
mpotter’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 9a5a725.

wizonesolutions’s picture

Awesome, thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.