WordPress.org

Make WordPress Core

Opened 8 months ago

Closed 8 months ago

Last modified 8 months ago

#49505 closed defect (bug) (fixed)

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

Reported by: garrett-eclipse Owned by: 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 8 months ago.
Reintroduces the widgetAdded string to avoid throwing a a11y speak error.
4f8435f17608bb5e9dce3e2d0ffca093.gif (1.6 MB) - added by audrasjb 8 months ago.

Download all attachments as: .zip

Change History (6)

@garrett-eclipse
8 months ago

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

#1 @garrett-eclipse
8 months 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
8 months 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
8 months 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
8 months ago

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