Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#34515 closed defect (bug) (fixed)

Edit tags PHP notice and admin notice

Reported by: afercia Owned by: afercia
Priority: normal Milestone: 4.5
Component: Administration Version: 4.4
Severity: normal Keywords: has-patch has-screenshots
Cc: Focuses: ui

Description

In edit-tag-form.php there's an initial check for an empty $tag_ID, when there's no ID a PHP notice is displayed and an admin notice too.

The admin notice should probably have a red border since it's an error (currently it uses the CSS class updated) and probably shouldn't be dismissible since PHP returns and there's nothing else to display.

To reproduce, just don't pass the tag_ID value in the query string:

https://cldup.com/jGyVgFHJh0.png

Attachments (3)

34515.patch​ (1.1 KB ) - added by afercia 11 years ago.
34515.2.patch​ (1.5 KB ) - added by afercia 11 years ago.
34515.3.patch​ (1.5 KB ) - added by afercia 11 years ago.

Download all attachments as: .zip

Change History (8)

@afercia
11 years ago

#1 @afercia
11 years ago

  • Keywords has-patch has-screenshots added

Screenshots with the proposed patch applied:

https://cldup.com/rd1bvcJ5LS.png

@afercia
11 years ago

#2 @afercia
11 years ago

  • Milestone Awaiting Review → 4.5
  • Owner set to afercia
  • Status new → assigned
  • Version 4.3 → 4.4

Refreshed patch, trying to prevent a couple of potential PHP notices.

#3 @michaelarestad
11 years ago

This seems more like warning territory to me. Maybe notice-warning would be a better fit.

@afercia
11 years ago

#4 @afercia
11 years ago

Refreshed patch, now using notice-warning:

https://cldup.com/RQk8Rk9fC8.png

#5 @afercia
11 years ago

  • Resolution → fixed
  • Status assigned → closed

In 35875:

When editing terms, properly display an admin notice-warning when tag_ID is empty.

Also, avoids two related PHP notices when empty or not set (and thus the global $tag is a WP_Error object).

Fixes: #34515.

Note: See TracTickets for help on using tickets.