Problem/Motivation

Toolbar items - at the top level - without tray never become active. This is misleading for the user.

To replicate: implement hook_toolbar and create a toolbar item without a tray. Click the toolbar item.

Proposed resolution

Make sure the correct item is active.

Remaining tasks

-

User interface changes

The correct toolbar item is active.

API changes

-

Data model changes

-

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Bart Vanhoutte created an issue. See original summary.

Bart Vanhoutte’s picture

Version: 8.2.x-dev » 8.1.x-dev
Status: Active » Needs work
FileSize
1.27 KB

Found this behaviour in 8.1.2, might be present in 8.2.x-dev as well. I haven't had the time to check yet so we might want to fix this in 8.2.x-dev and backport it to 8.1.x-dev.

To get this working I've applied the patch attached and added an HTML ID to the toolbar item. I suggest we use this patch and document the fact that toolbar items without a tray need an HTML ID in order to get the active state.

Bart Vanhoutte’s picture

Title: Toolbar item without tray never becomes active. » Toolbar item at top level without tray never becomes active.
Issue summary: View changes
Bart Vanhoutte’s picture

Issue tags: +Needs manual testing
Bart Vanhoutte’s picture

Status: Needs work » Needs review

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.

Ashley George’s picture

I don't think this patch works. Certainly not in the following way. Here's how I tested:

  • On 8.1.x, hacked the core Shortcut module so that the shortcuts toolbar item doesn't include a tray.
  • Rebuild Cache. Reload a page. Click on 'shortcuts' toolbar item.
  • Notice that we are taken to admin/config/user-interface/shortcut and toolbar item isn't highlighted.
  • Apply patch.
  • Rebuild Cache. Reload a page. Click on 'shortcuts' toolbar item.
  • Notice that we are taken to admin/config/user-interface/shortcut and toolbar item isn't highlighted again.

I appreciate there are a lot of ways to configure a toolbar item so maybe I didn't do the right thing. But certainly in the situation I describe, the shortcut toolbar item should be highlighted to show that the user is on the shortcuts page!

Ashley George’s picture

@Bart Vanhoutte do you think this is fair enough. Have I tested in the right way? If not could you provide some extra details on your steps to recreate.

Otherwise, I guess it's going back to 'Needs Work'.

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.

wturrell’s picture

Status: Needs review » Postponed (maintainer needs more info)
Issue tags: +Needs issue summary update, +Needs screenshots

[EDITED] (sorry, I misunderstood at first)

Can you clarify the issue a bit more? e.g. give some example code and steps to reproduce original problem.

i.e. if a toolbar hasn't got an associated tray, what would be the value to the user of highlighting it with .is-active? Isn't it only beneficial if there are further options for them to select?

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.

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

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

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

pameeela’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)
Issue tags: +Bug Smash Initiative

Thanks for reporting this issue. We rely on issue reports like this one to resolve bugs and improve Drupal core.

As part of the Bug Smash Initiative, we are triaging issues that are marked "Postponed (maintainer needs more info)".

Since there were no specific steps to reproduce the issue provided since the issue was postponed, I'm marking the issue "Closed (cannot reproduce)". If anyone can provide complete steps to reproduce the issue (starting from "Install Drupal core"), document those steps in the issue summary and set the issue status back to "Active".

Thanks!