Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#42488 closed defect (bug) (fixed)

Link field in Image Widget does not report invalidity

Reported by: westonruter's profile westonruter Owned by: westonruter's profile westonruter
Milestone: 4.9 Priority: normal
Severity: normal Version: 4.9
Component: Widgets Keywords: has-patch has-screenshots dev-reviewed commit
Focuses: Cc:

Description (last modified by westonruter)

Reported at https://wordpress.org/support/topic/widgets-displaying-saving/ by @newb1e:

under appearence > widgets I’ve noticed that if you put the image widget in a widget area and type in a link without http:// at the beginning, you can’t save the widget, but there is no notice what’s going on. Just nothing happens.

There should be some indication of an invalid URL.

This is regarding the link URL field which was added to the image widget in [41252] for #41274.

Attachments (4)

add-custom-menu-item-invalid-url.png (67.8 KB) - added by westonruter 7 years ago.
42488.0.diff (564 bytes) - added by westonruter 7 years ago.
valid.png (451.1 KB) - added by westonruter 7 years ago.
invalid.png (450.9 KB) - added by westonruter 7 years ago.

Download all attachments as: .zip

Change History (15)

#1 @westonruter
7 years ago

At the very least we should style the URL field to indicate the invalidity as can be seen when supplying a bad URL when adding a Custom Link as a nav menu item. See add-custom-menu-item-invalid-url.png.

#2 @westonruter
7 years ago

  • Description modified (diff)

@westonruter
7 years ago

@westonruter
7 years ago

@westonruter
7 years ago

#3 @westonruter
7 years ago

  • Keywords has-patch has-screenshots added

42488.0.diff adds the same red border outline to the link URL field which is added when attempting to add an invalid URL for a Custom Link nav menu item.

See invalid.png and valid.png.

This ticket was mentioned in Slack in #core-customize by westonruter. View the logs.


7 years ago

#5 @melchoyce
7 years ago

LGTM 👍

#6 @melchoyce
7 years ago

PS — let's add some text validation in 4.9.1 to say why there's an error.

#7 @westonruter
7 years ago

  • Keywords dev-reviewed commit added

#8 @westonruter
7 years ago

  • Owner set to westonruter
  • Status changed from new to accepted

#9 @westonruter
7 years ago

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

In 42140:

Widgets: Style the Image Widget's link field as invalid when a bad URL is supplied.

Fixes issue where user may supply an invalid URL and be unable to save the widget on the Widgets admin screen without being told why.

Amends [41252].
See #41274.
Fixes #42488.

#10 @westonruter
7 years ago

In 42141:

Widgets: Style the Image Widget's link field as invalid when a bad URL is supplied.

Fixes issue where user may supply an invalid URL and be unable to save the widget on the Widgets admin screen without being told why.

Amends [41252].
See #41274.
Fixes #42488 for 4.9.

#11 @westonruter
7 years ago

Note that in the Customizer if a user supplies the value "example.com" then it will automatically get converted into "http://example.com" because the field will sync with the server's esc_url_raw() sanitization logic.

Note: See TracTickets for help on using tickets.