WordPress.org

Make WordPress Core

Opened 3 months ago

Closed 3 months ago

#40816 closed defect (bug) (fixed)

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

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

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 3 months ago.

Download all attachments as: .zip

Change History (6)

#1 @iandunn
3 months ago

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

@afercia
3 months ago

#2 @afercia
3 months ago

  • Keywords has-patch added; needs-patch removed

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

#3 @iandunn
3 months 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
3 months 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
3 months 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.