Checking for $tabs variable being empty in theme templates is returning a non-empty array even when there are no links.
This variable is populated by theme system via menu_local_tabs. I think that either menu or theme systems should return an empty array or we should change the way core themes check for the existence of tabs.

Patch for menu module.

Comments

theborg’s picture

StatusFileSize
new1.04 KB

Re-test with some changes.

mahtoranjeet’s picture

Reproduced the Bugs

  1. Download and Install New drupal8
  2. Now I have print $tabs variable. It shows the below array if tab is not available
    Array (
    [#theme] => menu_local_tasks
    [#primary] =>
    [#secondary] =>
    )
  3. Now downloaded patch and try to apply the above patch by using command (git apply -v menu_tabs.patch. (From drupal installation directory)
  4. It give me error message (Checking patch includes/menu.inc...
    error: includes/menu.inc: No such file or directory)
  5. Then I add path code in core/include/menu.inc file
    on line no 2221
     $tabs = array(
         '#theme' => 'menu_local_tasks',
         '#primary' => menu_primary_local_tasks(),
         '#secondary' => menu_secondary_local_tasks(),
       );
    return (!empty($tabs['#primary']) && !empty($tabs['#secondary']) ? $tabs : array());
    
  6. Then print $tabs variable it return empty array if tag is not there
mahtoranjeet’s picture

StatusFileSize
new739 bytes

In patch seems path was wrong, So created new patch

Status: Needs review » Needs work

The last submitted patch, tabsthemereturnemptyarray-1298232-2.patch, failed testing.

mahtoranjeet’s picture

Status: Needs work » Needs review
StatusFileSize
new1.24 KB

New patch with path change

Status: Needs review » Needs work

The last submitted patch, menu_tabs-1298232-3.patch, failed testing.

mgifford’s picture

Assigned: theborg » Unassigned
Issue summary: View changes
rahul.shinde’s picture

Assigned: Unassigned » rahul.shinde
Issue tags: +#punedrupalgroup #SprintWeekend2015
rahul.shinde’s picture

Status: Needs work » Needs review

@theborg, it seems the issue has been fixed. But can you please review the changes that you were looking for.

rahul.shinde’s picture

Assigned: rahul.shinde » Unassigned
piyuesh23’s picture

Issue tags: -#punedrupalgroup #SprintWeekend2015 +#punedrupalgroup, +#SprintWeekend2015
piyuesh23’s picture

Issue tags: -#SprintWeekend2015 +SprintWeekend2015
mgifford’s picture

StatusFileSize
new1.24 KB

re-uploading last patch.

Status: Needs review » Needs work

The last submitted patch, 13: menu_tabs-1298232-3.patch, failed testing.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

voleger’s picture

Status: Needs work » Closed (outdated)

Looks like menu_local_tabs() already fixed.