WordPress.org

Make WordPress Core

Opened 17 months ago

Closed 7 months ago

#43703 closed defect (bug) (fixed)

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

Reported by: birgire Owned by: 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 17 months ago.
Dismissible admin notice
error-green.jpg (12.5 KB) - added by birgire 17 months ago.
The update error is currently shown in green.
error-red.jpg (12.6 KB) - added by birgire 17 months ago.
Here's the error shown in red, as expected
43703.diff (1.3 KB) - added by birgire 17 months ago.
43703-2.diff (1.1 KB) - added by birgire 7 months ago.
43703-2.2.diff (1.1 KB) - added by birgire 7 months ago.
edit-category-success-notice-with-43703-2.2.diff.jpg (14.0 KB) - added by birgire 7 months ago.

Download all attachments as: .zip

Change History (16)

@birgire
17 months ago

Dismissible admin notice

@birgire
17 months ago

The update error is currently shown in green.

@birgire
17 months ago

Here's the error shown in red, as expected

@birgire
17 months ago

#1 @birgire
17 months 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.
Last edited 17 months ago by birgire (previous) (diff)

#2 @SergeyBiryukov
17 months ago

  • Milestone changed from Awaiting Review to 5.0

#3 @pento
10 months ago

  • Milestone changed from 5.0 to 5.1

#4 @afercia
7 months 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 7 months ago by afercia (previous) (diff)

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


7 months ago

#6 @jaymanpandya
7 months 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
7 months ago

@birgire
7 months ago

#7 @birgire
7 months 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
7 months ago

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

#9 @pento
7 months 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.