When has no tabs on the page then an empty <div> goes to output. Like this: <div class="tabs clearfix"></div>
Because the $tabs variable in the region--content.tpl.php file is an array. Like this:

Array
(
    [#theme] => menu_local_tasks
    [#primary] =>
    [#secondary] =>
)

This check is not enough:

<?php
 
if ($tabs) :
?>

This is better:

<?php
 
if ($tabs && !empty($tabs['#primary']) :
?>
Files: 
CommentFileSizeAuthor
#7 tab_condition_omega-7x-4x_1332732-7.patch599 bytesChris Burge
Test request sent.
[ View ]
#3 tab_condition_1332732-4.patch845 bytesHydra
Test request sent.
[ View ]

Comments

hmmdinger’s picture

Agreed. I just spent a good bit of time debugging some extra space in IE7 that ended up being because of this empty $tabs div.

othermachines’s picture

Marked #1385770: Tabs Wrapper printed even if tabs is empty as duplicate of this issue.

Hydra’s picture

Status:Active» Needs review
StatusFileSize
new845 bytes
Test request sent.
[ View ]

Had this issue also some times...

Cellar Door’s picture

Assigned:Unassigned» himerus

ah IE7 how we love you so... :)

himerus’s picture

Assigned:himerus» Unassigned
Status:Needs review» Fixed

Comitted to 7.x-3.x

Status:Fixed» Closed (fixed)

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

Chris Burge’s picture

Version:7.x-3.x-dev» 7.x-4.x-dev
Issue summary:View changes
Status:Closed (fixed)» Active
StatusFileSize
new599 bytes
Test request sent.
[ View ]

Re-opening this issue as there is a regression in 7.x-4.x. The line is question is as follows in 7.x-4.x:

<?php print render($tabs); ?>

This results in the re-introduction of the bug fixed by this issue in 7.x-3.x. This issue proposes fixing the regression by changing the line as follows:

<?php print ($tabs && !empty($tabs['#primary']) ? render($tabs) : '' ); ?>

Patch is attached.

Chris Burge’s picture

I haven't tested either 7.x-5.x, and 8.x-5.x, but neither of these versions check !empty($tabs['#primary']. It is probable that this bug exists in both versions, too. I'll defer to someone more active with the project on those versions.

Chris Burge’s picture

Status:Active» Needs review
tedfordgif’s picture