Opened 3 years ago

Closed 2 years ago

#15285 closed defect (bug) (fixed)

PHP notices when doing quick edit of link categories

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

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 3 years ago.
Change arguments passed to do_action for quick_edit_custom_box action
15285.diff (505 bytes) - added by nacin 2 years ago.

Download all attachments as: .zip

Change History (14)

Change arguments passed to do_action for quick_edit_custom_box action

  • Keywords close added; dev-feedback removed

This looks to have been fixed since I reported it

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

It was never fixed apparently.

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

comment:5 follow-up: ↓ 6   scribu2 years ago

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

comment:6 in reply to: ↑ 5   westi2 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?

comment:7 follow-up: ↓ 8   westi2 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

comment:8 in reply to: ↑ 7   westi2 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 :-)

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

nacin2 years ago

  • Keywords has-patch commit added
  • 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.

Note: See TracTickets for help on using tickets.