Make WordPress Core

Opened 9 years ago

Closed 9 years ago

#40816 closed defect (bug) (fixed)

Events widget form can be submitted when empty or contains just spaces

Reported by: afercia Owned by: afercia
Priority: normal Milestone: 4.8
Component: Administration Version: 4.8
Severity: minor Keywords: good-first-bug has-patch
Cc: Focuses: ui

Description

In order to improve the user experience and reduce the requests sent to the API, it would be great to consider introducing a simple check to avoid the events widget form can be submitted when the form field is empty.

To reproduce what happens now:

  • open the form to change location
  • make sure the form field is empty and submit: the form gets submitted (it uses the last location?)
  • repeat inserting just spaces in the form field and submit: the form gets submitted

Attachments (1)

40816.diff (841 bytes ) - added by afercia 9 years ago.

Download all attachments as: .zip

Change History (6)

#1 @iandunn
9 years ago

  • Component WidgetsAdministration
  • Keywords needs-patch good-first-bug added
  • Severity normalminor

@afercia
9 years ago

#2 @afercia
9 years ago

  • Keywords has-patch added; needs-patch removed

40816.diff returns early if the search field is empty or contained only spaces.

#3 @iandunn
9 years ago

I don't think I'll have time to test 40816.diff, but I looked at the diff and it sounds good to me.

#4 @afercia
9 years ago

  • Owner set to afercia
  • Status newassigned

Thanks @iandunn! Just noticed a typo feild > field, will fix during commit.

#5 @afercia
9 years ago

  • Resolutionfixed
  • Status assignedclosed

In 40799:

Dashboard: Don't trigger an Events search when the search field is empty.

Fixes #40816.

Note: See TracTickets for help on using tickets.