WordPress.org

Make WordPress Core

Opened 4 years ago

Last modified 14 months ago

#16243 new enhancement

Unhelpful error messages when updating default category

Reported by: iamfriendly Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 3.0.4
Component: Taxonomy Keywords: has-patch ui-feedback
Focuses: administration Cc:

Description

If we try and change the default category slug to one that has already been used we get conflicting error messages between quick edit and full edit.

If you use Full Edit you're simply told Item Not Updated however, if you use quick edit, you are informed that the slug has already been used.

The full edit error message is, I think, on line 223 of wp-admin/edit-tags.php - I'm unable to find where the error message for the quick edit functionality is, however.

Having correct and useful copy in error messages is vital, especially for relative newcomers to WP.

This oversight was found by Relly Annett-Baker (@RellyAB on twitter) - one of the best copy writers and content strategists out there. Perhaps we could look at overhauling the error messages and ask (someone like) Relly to give them a once-over or offer advice on them.

Attachments (3)

edit-tags.php (14.9 KB) - added by iamfriendly 4 years ago.
edit-tags.php with additional error reports
16243.2.diff (621 bytes) - added by solarissmoke 4 years ago.
16243.diff (621 bytes) - added by solarissmoke 4 years ago.

Download all attachments as: .zip

Change History (12)

comment:1 @scribu4 years ago

  • Component changed from Warnings/Notices to Administration
  • Keywords ux-feedback added; error category copy warnings notices removed

comment:2 @iamfriendly4 years ago

As an addition, the quick edit notice is:

"The slug [slug-here] is already in use by another term"

Which is much more useful.

This appears to be from Line 2285 of wp-includes/taxonomy.php

After looking further through edit-tags.php it appears that if there is absolutely any error at all then it simply punts the same message 'Item not updated'. This can be seen on line 143-146 which basically says if there's no error say 'Item updated' but if there is, say 'Item not updated'

From what I can tell there's no checking what the actual error is.

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

comment:3 @scribu4 years ago

  • Keywords needs-patch added; ux-feedback removed

I think it's pretty clear that adding more descriptive error messages is a good idea.

We'll leave ux-feedback for after we have a patch.

@iamfriendly4 years ago

edit-tags.php with additional error reports

comment:4 @iamfriendly4 years ago

I've added a horrible hack which adds some extra error reporting to the output when an error is thrown. This basically checks for the existence of certain items in the $ret object. There must be a better way to handle this, though, as it's basically hardcoded in. Possibly use WP_Error() in the future? That's beyond my abilities at the moment, but at least this way there's the same feedback given from quick edit and full edit.

comment:5 @solarissmoke4 years ago

  • Keywords has-patch added; needs-patch removed

Seems better to use the error that wp_update_term issues and wp_die rather than redirect?

@solarissmoke4 years ago

@solarissmoke4 years ago

comment:6 @solarissmoke4 years ago

Oops managed to attach patch twice

comment:7 @johnbillion3 years ago

  • Cc johnbillion@… added

comment:8 @c3mdigital19 months ago

  • Keywords ui-feedback added

I like using the same error that wp_update_term issues but not sure about the wp_die(); What about not doing the redirect and reload the page instead with the error message in the admin notice?

comment:9 @nacin14 months ago

  • Component changed from Administration to Taxonomy
  • Focuses administration added
Note: See TracTickets for help on using tickets.