Make WordPress Core

Opened 10 years ago

Closed 9 years ago

#34515 closed defect (bug) (fixed)

Edit tags PHP notice and admin notice

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

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 10 years ago.
34515.2.patch (1.5 KB) - added by afercia 9 years ago.
34515.3.patch (1.5 KB) - added by afercia 9 years ago.

Download all attachments as: .zip

Change History (8)

@afercia
10 years ago

#1 @afercia
10 years ago

  • Keywords has-patch has-screenshots added

Screenshots with the proposed patch applied:

https://cldup.com/rd1bvcJ5LS.png

@afercia
9 years ago

#2 @afercia
9 years ago

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

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

#3 @michaelarestad
9 years ago

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

@afercia
9 years ago

#4 @afercia
9 years ago

Refreshed patch, now using notice-warning:

https://cldup.com/RQk8Rk9fC8.png

#5 @afercia
9 years ago

  • Resolution set to fixed
  • Status changed from assigned to 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.