Problem/Motivation

Drupal.announce() is used on the module listing page, to announce the number of results whenever the module-filter search box is used to narrow the range of modules shown.

However these announcements are not made if the Toolbar module is disabled.

The call to Drupal.announce() is in system.modules.js, but the library info doesn't declare drupal.announce as a dependency.

This doesn't cause a problem if the standard install profile was used, as the toolbar module pulls in the drupal.announce library as a dependency. The core toolbar module isn't a required module though, and contrib modules could provide an alternative toolbar some day. The minimal install profile in core does not install Toolbar module.

Steps to reproduce

Compare the admin/modules page between a standard and minimal install.

  1. Standard profile behaves as expected, announcing a result-count when the module filter is used.
    1. Install Drupal with the standard profile. This will enable Toolbar module.
    2. Visit admin/modules with a screenreader running.
    3. Use the module filter to search for "cache". The module list will be updated to show just 2 modules, and the screenreader will announce that "2 modules are available in the modified list".
    4. Browser dev tools confirm that Drupal.announce exsts as a function.
  2. Minimal profile does not provide screenreader feedback when module filter is used.
    1. Install Drupal with the minimal profile. Toolbar module will not be enabled.
    2. Visit admin/modules with a screenreader running.
    3. Use the module filter to search for "cache". The module list will be updated to show just 2 modules, but the expected screenreader announcement does not happen.
    4. Browser JS console reports an error: "Drupal.announce is not a function".

Proposed resolution

Declare core/drupal.announce as a dependency of system/drupal.system.modules

Remaining tasks

Make a patch - DONE.

User interface changes

None.

API changes

None.

Data model changes

None.

Comments

andrewmacpherson created an issue. See original summary.

andrewmacpherson’s picture

andrewmacpherson’s picture

Status: Active » Needs review

This does the trick. I tested the patch with simplytest.me and ChromeVox.

After a minimal install, announce.js is loaded on the modules listing page, and the result count is announced when using the module filter.

andrewmacpherson’s picture

Issue summary: View changes
andrewmacpherson’s picture

Issue summary: View changes
andrewmacpherson’s picture

Issue summary: View changes

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.

BarisW’s picture

Status: Needs review » Reviewed & tested by the community

I've tested the patch on simplytest and I can confirm that it works with a Minimal profile install.

andrewmacpherson’s picture

@BarisW thanks!

andrewmacpherson’s picture

We can actually write a FunctionalJavascript test to confirm that the Drupal.announce() div gets updated correctly when using the module filter.

Over at #2715663: Use Drupal.formatPlural for when announcing module-filter results for screenreader users the patch includes a FunctionalJavascript test which tests the module filter's basic functionality, and the Drupal.announce messages.

it's a bit of a chicken/egg scenario with these two issues, so I've just added a dependency on Toolbar module to the test in the other issue, until this one is fixed. That issue actually has more interesting stuff that needs testing, while this is just a simple library declaration.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed 55469c5 to 8.3.x and 7a80041 to 8.2.x. Thanks!

Okay lets get the test added in #2715663: Use Drupal.formatPlural for when announcing module-filter results for screenreader users

  • alexpott committed 55469c5 on 8.3.x
    Issue #2702969 by andrewmacpherson: Module filter does not announce...

  • alexpott committed 7a80041 on 8.2.x
    Issue #2702969 by andrewmacpherson: Module filter does not announce...

Status: Fixed » Closed (fixed)

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

andrewmacpherson’s picture

Issue tags: +WCAG, +wcag21

This relates to the new WCAG 2.1 success criterion : 3.2.7 Change of Content.