Make WordPress Core

Opened 6 years ago

Closed 5 years ago

#43703 closed defect (bug) (fixed)

Edit Category screen - Error shown in green and admin notice not dismissible.

Reported by: birgire's profile birgire Owned by: pento's profile pento
Milestone: 5.1 Priority: normal
Severity: normal Version:
Component: Taxonomy Keywords: has-patch has-screenshots ux-feedback
Focuses: administration Cc:

Description

When we edit a category, on the Edit Category screen, then there are two things that need adjustments:

  1. The "Category updated." admin notice is currently not dismissible.
  2. The "Category not updated." admin notice is currently shown in green (not red).


To replicate part 2, one can e.g. disable JS and update the term without a name.

Example location:

/wp-admin/term.php?taxonomy=category&tag_ID=123

The corresponding part that displays the message for categories, tags and other terms:

https://core.trac.wordpress.org/browser/tags/4.9.5/src/wp-admin/edit-tag-form.php#L73-L82

Attachments (7)

dismissible.jpg (18.6 KB) - added by birgire 6 years ago.
Dismissible admin notice
error-green.jpg (12.5 KB) - added by birgire 6 years ago.
The update error is currently shown in green.
error-red.jpg (12.6 KB) - added by birgire 6 years ago.
Here's the error shown in red, as expected
43703.diff (1.3 KB) - added by birgire 6 years ago.
43703-2.diff (1.1 KB) - added by birgire 5 years ago.
43703-2.2.diff (1.1 KB) - added by birgire 5 years ago.
edit-category-success-notice-with-43703-2.2.diff.jpg (14.0 KB) - added by birgire 5 years ago.

Download all attachments as: .zip

Change History (16)

@birgire
6 years ago

Dismissible admin notice

@birgire
6 years ago

The update error is currently shown in green.

@birgire
6 years ago

Here's the error shown in red, as expected

@birgire
6 years ago

#1 @birgire
6 years ago

43703.diff is a suggested patch that:

  • let's the admin notice have the error class (displayed as red) if the $msg index is 5 for not updated), else the updated class (displayed as green).
  • adds the notice is-dismissible classes to the admin notice.
  • escapes the message output.
Version 0, edited 6 years ago by birgire (next)

#2 @SergeyBiryukov
6 years ago

  • Milestone changed from Awaiting Review to 5.0

#3 @pento
5 years ago

  • Milestone changed from 5.0 to 5.1

#4 @afercia
5 years ago

  • Keywords ux-feedback added

Not sure it is meant to be dismissible, as it contains a link to "go back" to avoid a dead end for users. See #26758 (ticket number on the changeset [34202] is wrong). Asking for UX feedback.

The green color on the error notice need to be fixed though :)

[Edit] Also, the CSS classes error and updated are legacy: the new classes notice-error and notice-success should be used instead.

Last edited 5 years ago by afercia (previous) (diff)

This ticket was mentioned in Slack in #design by afercia. View the logs.


5 years ago

#6 @jaymanpandya
5 years ago

Yes, as @afercia mentioned the error message should have a red strip instead of green but I think the message bar should not be dismissible as there is a link to go back.

@birgire
5 years ago

@birgire
5 years ago

#7 @birgire
5 years ago

Thanks @afercia and @jaymanpandya for the review.

I updated the patch in 43703-2.2.diff with:

  • Notice is not dismissable.
  • Uses notice notice-success and notice notice-error CSS classes.

The screenshot in edit-category-success-notice-with-43703-2.2.diff.jpg shows the notice when a category is updated.

#8 @pento
5 years ago

  • Owner set to pento
  • Status changed from new to accepted

#9 @pento
5 years ago

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

In 44663:

Terms: Show error colours when a term fails to update.

Props birgire, afercia, jaymanpandya.
Fixes #43703.

Note: See TracTickets for help on using tickets.