Make WordPress Core

Opened 10 years ago

Closed 6 years ago

Last modified 6 years ago

#30361 closed task (blessed) (fixed)

Correctly handle DB queries failing

Reported by: pento's profile pento Owned by: pento's profile pento
Milestone: 4.2 Priority: high
Severity: normal Version:
Component: General Keywords:
Focuses: ui, administration Cc:

Description

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 (8)

#1 @pentoCore Committer
10 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 @azaozzLead Developer
10 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 10 years ago by azaozz (previous) (diff)

#3 @pentoCore Committer
10 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 @johnbillionCore Committer
10 years ago

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

#5 @johnbillionCore Committer
10 years ago

  • Version trunk deleted

#6 @pentoCore Committer
10 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.

#7 @desrosjCore Committer
6 years ago

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

This appears to have been committed and included with WordPress 4.2.

I am closing this out as fixed. @pento please reopen if there still more parts to this.

#8 @pentoCore Committer
6 years ago

The initial idea was about providing feedback when the save failed, [31064] just strips invalid characters as a workaround.

I don't think it's going to get any further attention in a hurry, I'm fine with leaving it closed.

Note: See TracTickets for help on using tickets.