Make WordPress Core

Opened 13 years ago

Closed 10 years ago

#16793 closed defect (bug) (fixed)

Bulk inline post edit doesn't show categories or tags if the CPT doesn't support titles

Reported by: scribu's profile scribu Owned by:
Milestone: 4.0 Priority: normal
Severity: normal Version:
Component: Quick/Bulk Edit Keywords: has-patch commit
Focuses: Cc:

Description

  1. Register a CPT that doesn't support titles:
add_action( 'init', function() {
	register_post_type( 'foo', array(
		'show_ui' => true,
		'label' => 'Foo',
		'supports' => array( 'editor' ),
		'taxonomies' => array( 'category', 'post_tag' )
	) );
} );
  1. Create a 'foo' post.
  1. Go to wp-admin/edit.php?post_type=foo and choose the 'Edit' bulk action.

Expected behaviour: shows the category checkbox list and the tag textarea.

Actual behaviour: only the status dropdown is shown.

Attachments (3)

16793.diff (524 bytes) - added by scribu 13 years ago.
16793.2.diff (1.0 KB) - added by scribu 13 years ago.
optimize selectors
16793.3.diff (2.3 KB) - added by scribu 13 years ago.
selector cleanup + DRY

Download all attachments as: .zip

Change History (16)

@scribu
13 years ago

#1 @markmcwilliams
13 years ago

I found it worked before, and after Scribu; unless I'm holding it wrong?

#2 @scribu
13 years ago

If you're using Chrome, without the patch, you should also be getting a JS error in the console:

Uncaught TypeError: Cannot read property 'firstChild' of null

#3 @scribu
13 years ago

Note that we're talking about the Edit option in the dropdown, not the quick action Edit link on each post.

#4 @markmcwilliams
13 years ago

OK so I was holding it wrong, I can confirm the initial error, and that the patch works! :)

@scribu
13 years ago

optimize selectors

#5 @ryan
13 years ago

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

(In [17504]) Don't perform taxonomy queries for single post requests. Props scribu. fixes #16793 for trunk

@scribu
13 years ago

selector cleanup + DRY

#6 @scribu
13 years ago

16793.3.diff:

Contrary to popular belief, $('some selector', context) is not faster than context.find('some selector'). It's just harder to read.

Also, there was a callback written twice, once for qeRow.keyup and again for bulkRow.keyup.

Last edited 13 years ago by scribu (previous) (diff)

#7 @scribu
13 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

#8 @somatic
13 years ago

  • Cc israel@… added

another casualty of this problem is that any javascript (and jQuery) that would be executed on the wp-admin/edit.php?post_type=foo screen can't run, as the javascript engine stops at that initial Uncaught TypeError: Cannot read property 'firstChild' of null error. I had been adding some additional sorting options via jQuery, and couldn't figure out why they appeared on some post type edit lists, but not this one, until I found this ticket...

I can confirm that add the supports => titles does fix the problem, but it's not absolute: I have two CPTS, registered with basically identical args, and neither supports titles - but one manifests the javascript error on edit.php and the other does not...

Version 0, edited 13 years ago by somatic (next)

#9 @gizburdt
10 years ago

The expected behaviour is not showing up for me

#10 @ocean90
10 years ago

  • Component changed from Administration to Quick/Bulk Edit

#11 @helen
10 years ago

  • Milestone Future Release deleted
  • Resolution set to worksforme
  • Status changed from reopened to closed

Cannot reproduce now.

#12 @SergeyBiryukov
10 years ago

  • Keywords commit added
  • Milestone set to 4.0
  • Resolution worksforme deleted
  • Status changed from closed to reopened

I can still reproduce the issue, and 16793.diff fixes it. See comment:3:

Note that we're talking about the Edit option in the dropdown, not the quick action Edit link on each post.

#13 @SergeyBiryukov
10 years ago

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

Fixed in [28600].

Note: See TracTickets for help on using tickets.