WordPress.org

Make WordPress Core

Opened 9 years ago

Closed 9 years ago

Last modified 5 years ago

#15285 closed defect (bug) (fixed)

PHP notices when doing quick edit of link categories

Reported by: solarissmoke Owned by:
Milestone: 3.1 Priority: normal
Severity: minor Version: 3.1
Component: Taxonomy Keywords: has-patch commit
Focuses: Cc:
PR Number:

Description

I was editing some link categories (debug enabled) and came across the following when trying to "quick edit" a category:

PHP Notice:  Undefined variable: type in \wp-admin\includes\class-wp-terms-list-table.php on line 344
PHP Notice:  Undefined property: stdClass::$taxonomy in \wp-admin\includes\class-wp-terms-list-table.php on line 344

These are passed to the quick_edit_custom_box action - remnants from the old inline_edit_term_row function which has been removed - see #14579.

Proposed patch to follow, although I'm not confident it's appropriate.

Attachments (2)

15285.patch (754 bytes) - added by solarissmoke 9 years ago.
Change arguments passed to do_action for quick_edit_custom_box action
15285.diff (505 bytes) - added by nacin 9 years ago.

Download all attachments as: .zip

Change History (15)

@solarissmoke
9 years ago

Change arguments passed to do_action for quick_edit_custom_box action

#1 @solarissmoke
9 years ago

  • Keywords close added; dev-feedback removed

This looks to have been fixed since I reported it

#2 @PeteMall
9 years ago

  • Keywords close removed
  • Milestone changed from Awaiting Review to 3.1
  • Resolution set to fixed
  • Status changed from new to closed

#3 @scribu
9 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

It was never fixed apparently.

#4 @scribu
9 years ago

(In [17027]) Fix notices in quick-edit. See #15285

#5 follow-up: @scribu
9 years ago

'quick_edit_custom_box' is also used on the posts list table. Thinking we should rename it.

#6 in reply to: ↑ 5 @westi
9 years ago

Replying to scribu:

'quick_edit_custom_box' is also used on the posts list table. Thinking we should rename it.

Is one of these new in 3.1 or did we have this issue in 3.0?

#7 follow-up: @westi
9 years ago

Checked 3.0 branch:

quick_edit_custom_box was only previously used in inline_edit_term_row so we should rename the one in the posts list table to be unique

#8 in reply to: ↑ 7 @westi
9 years ago

Replying to westi:

Checked 3.0 branch:

quick_edit_custom_box was only previously used in inline_edit_term_row so we should rename the one in the posts list table to be unique

Scratch that:

3.0 branch:

./wp-admin/includes/template.php:		do_action( 'quick_edit_custom_box', $column_name, $type, $taxonomy );
./wp-admin/includes/template.php:		do_action( $bulk ? 'bulk_edit_custom_box' : 'quick_edit_custom_box', $column_name, $screen->post_type 

inline_edit_row && inline_edit_term_row

Trunk:

./wp-admin/includes/class-wp-posts-list-table.php:			do_action( $bulk ? 'bulk_edit_custom_box' : 'quick_edit_custom_box', $column_name, $screen->post_type );
./wp-admin/includes/class-wp-terms-list-table.php:			do_action( 'quick_edit_custom_box', $column_name, $tax->name );

So we have to live with these :-)

#9 @westi
9 years ago

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

#10 @nacin
9 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Noticed via #16046, I see a regression.

In 3.0, inline_edit_term_row() took $type ('edit-tags', 'categories', or 'edit-link-categories') and $taxonomy.

In 3.0 we didn't account for the merger of 'edit-tags' and 'categories'. It appears people didn't rely on this argument as we hadn't seen a report. That's fine with me.

But, the taxonomy argument has now moved. That's a problem for people adding custom column data here.

We should just pass 'edit-tags' consistently and bump the argument down one. This is also helpful to distinguish between post type and taxonomy usage of the filter.

@nacin
9 years ago

#11 @nacin
9 years ago

  • Keywords has-patch commit added

#12 @nacin
9 years ago

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

(In [17193]) Restore original argument order for the taxonomy quick_edit_custom_box hook. fixes #15285.

This ticket was mentioned in Slack in #docs by drew. View the logs.


5 years ago

Note: See TracTickets for help on using tickets.