Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#49505 closed defect (bug) (fixed)

wpWidgets.l10n.widgetAdded string was unintentionally removed in 5.0 causing js error

Reported by: garrett-eclipse's profile garrett-eclipse Owned by: audrasjb's profile audrasjb
Milestone: 5.4 Priority: normal
Severity: normal Version: 5.0
Component: Widgets Keywords: has-patch
Focuses: accessibility, javascript Cc:

Description

Hello,

When you use the 'Add Widget' button to introduce a widget to the sidebar it throws a javascript error;

a11y.min.js?ver=2.5.1:formatted:102 Uncaught TypeError: Cannot read property 'replace' of undefined
    at l (a11y.min.js?ver=2.5.1:formatted:102)
    at Module.c (a11y.min.js?ver=2.5.1:formatted:124)
    at widgets.min.js?ver=5.3.3-alpha-47319:formatted:341

This is caused by the widgetAdded string being missing from the wpWidgets.l10n array, this string is used for the a11y speak function but since it was accidentally removed in [44163] for #45145 an error is now thrown.

Patch incoming.

Attachments (2)

49505.diff (759 bytes) - added by garrett-eclipse 5 years ago.
Reintroduces the widgetAdded string to avoid throwing a a11y speak error.
4f8435f17608bb5e9dce3e2d0ffca093.gif (1.6 MB) - added by audrasjb 5 years ago.

Download all attachments as: .zip

Change History (6)

@garrett-eclipse
5 years ago

Reintroduces the widgetAdded string to avoid throwing a a11y speak error.

#1 @garrett-eclipse
5 years ago

  • Keywords has-patch needs-testing added

In 49505.diff I've reintroduced the string for widgetAdded to avoid the a11y speak error.

#2 @audrasjb
5 years ago

  • Focuses javascript added
  • Keywords needs-testing removed
  • Milestone changed from Awaiting Review to 5.5
  • Owner set to audrasjb
  • Status changed from new to accepted

Hi @garrett-eclipse,

I can reproduce the issue.
The patch works, moving to next release :)

Thanks!
Jb

#3 @SergeyBiryukov
5 years ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In 47353:

Accessibility: Widgets: Restore missing string in script loader.

The string was previously added in [42794] and accidentally removed in [44163].

Props garrett-eclipse, audrasjb.
Fixes #49505.

#4 @SergeyBiryukov
5 years ago

  • Milestone changed from 5.5 to 5.4
Note: See TracTickets for help on using tickets.