Make WordPress Core

Opened 7 years ago

Closed 7 years ago

#40816 closed defect (bug) (fixed)

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

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


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 7 years ago.

Download all attachments as: .zip

Change History (6)

#1 @iandunn
7 years ago

  • Component changed from Widgets to Administration
  • Keywords needs-patch good-first-bug added
  • Severity changed from normal to minor

7 years ago

#2 @afercia
7 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
7 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
7 years ago

  • Owner set to afercia
  • Status changed from new to assigned

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

#5 @afercia
7 years ago

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

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.