Make WordPress Core

Opened 14 years ago

Closed 12 years ago

#16645 closed defect (bug) (fixed)

Inline edit defaults author to current user

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

Description

This one looks a bit like ticket #13982

Here is what happens :

  • I have created a custom post type that doesn't support the 'author' when registering it (with register_post_type)
  • I am doing an inline edit of a custom post authored by another user
  • the custom post author defaults to current user (ie the one who is performing the inline edit instead of the one who authored it)

This behavior is different from what you see with post type of post where inline edit wouldn't change the post author.

To debug it further, I have enabled the 'author' during the custom post type registration and the problem isn't there anymore in that case. So it is probably linked to the fact that 'author' wasn't entered in the supports array entry during the custom post type registration.

I am not sure if this is a bug or expected behavior but it would be nice to be able to have a common behavior accross post types weither 'author' is supported or not.

Attachments (4)

16645.diff (783 bytes) - added by garyc40 14 years ago.
don't modify author unless specifically told to do so
16645-refresh.diff (492 bytes) - added by c3mdigital 12 years ago.
Refresh of original patch
16645.patch (1.4 KB) - added by ocean90 12 years ago.
16645.2.patch (763 bytes) - added by ocean90 12 years ago.

Download all attachments as: .zip

Change History (15)

#1 follow-up: @knutsp
14 years ago

  • Cc knut@… added

I can confirm this. Had a few CPTs without author support. In the content table for the CPT the correct author showed, but after quick editing I was the suddenly the author of the content.

This became so confusing and that I had to re-enable author on the CPTs, at least to be able to correct it using the normal editor.

It seems logical that a CPT without author support may have an author silently set in the database, and the quick edit should respect this.

#2 in reply to: ↑ 1 ; follow-up: @nacin
14 years ago

Replying to knutsp:

It seems logical that a CPT without author support may have an author silently set in the database, and the quick edit should respect this.

Agreed. Don't think this is a regression over 3.0 though, is it?

@garyc40
14 years ago

don't modify author unless specifically told to do so

#3 in reply to: ↑ 2 @garyc40
14 years ago

  • Keywords has-patch added

Replying to nacin:

Agreed. Don't think this is a regression over 3.0 though, is it?

Seems to be a regression. This line exists in both 3.0 and 3.1, which causes this issue.

#4 follow-up: @nacin
14 years ago

Doesn't sound like a regression then -- custom post types (with a UI) were only introduced in 3.0.

#5 in reply to: ↑ 4 @garyc40
14 years ago

Replying to nacin:

Doesn't sound like a regression then -- custom post types (with a UI) were only introduced in 3.0.

Right, my bad, I was confused.

#6 @c3mdigital
12 years ago

Adding refreshed patch. This looks like an easy win.

@c3mdigital
12 years ago

Refresh of original patch

#7 @helen
12 years ago

  • Milestone changed from Awaiting Review to 3.7

#8 @SergeyBiryukov
12 years ago

  • Version changed from 3.1 to 3.0

@ocean90
12 years ago

#9 @ocean90
12 years ago

16645.patch is another approach. It adds a hidden field for post_author if the post type doesn't support authors.

@ocean90
12 years ago

#10 @jeremyfelt
12 years ago

  • Keywords commit added

Patch still goes in and works as expected. We could move the hidden input up to where the author dropdown is output when the post type does support author, but it is grouped nicely with other hidden fields in ocean90's patch.

#11 @nacin
12 years ago

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

In 25698:

Don't modify post_author during a quick edit when the post type doesn't support authors.

props ocean90.
fixes #16645.

Note: See TracTickets for help on using tickets.