Make WordPress Core

Opened 4 years ago

Last modified 3 years ago

#30361 assigned task (blessed)

Correctly handle DB queries failing

Reported by: pento Owned by: pento
Milestone: Future Release Priority: high
Severity: normal Version:
Component: General Keywords:
Focuses: ui, administration Cc:


Nearly all “Save”-type actions in wp-admin don’t react correctly when the DB query fails - they show a success message, without confirming that the save occurred.

All screens and forms need to be audited for correct behaviour. If there’s a screen you want to grab, please comment in this ticket, then upload a patch when you're done.

Change History (6)

#1 @pento
4 years ago

[30346] is how the post edit screen sanitizes data if the query fails, though it doesn't warn the user if the query fails a second time.

#2 @azaozz
4 years ago

What would be the "saving has failed" message and what action can we offer to the users so they can fix/try again?

Something like: "Saving failed. The text you've entered contains invalid characters. Please remove them and try again." won't make much sense unless we can somehow show/highlight the invalid chars. Not sure if that is even possible, if they are emoji on a Mac, they would look proper to the users.

Last edited 4 years ago by azaozz (previous) (diff)

#3 @pento
4 years ago

That's a pretty good point, we're better off removing the characters, so that users aren't required to dig through their changes to find the "invalid character".

I shall experiment a bit, and see what I come up with.

#4 @johnbillion
4 years ago

  • Milestone changed from 4.1 to Future Release
  • Owner set to pento
  • Status changed from new to assigned

#5 @johnbillion
4 years ago

  • Version trunk deleted

#6 @pento
3 years ago

In 31064:

Options: When updating options, make sure the user isn't trying to insert characters that aren't supported by the database character set.

See #30361.

Note: See TracTickets for help on using tickets.