Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#23623 closed defect (bug) (fixed)

Can't edit the content of a post with no title

Reported by: wonderboymusic's profile wonderboymusic Owned by: markjaquith's profile markjaquith
Milestone: 3.6 Priority: normal
Severity: normal Version: 2.1
Component: Posts, Post Types Keywords: has-patch
Focuses: Cc:

Description (last modified by wonderboymusic)

  1. Add new post screen: post-new.php
  1. Don't enter a title, enter some arbitrary content: "This is a post."
  1. Click "Publish"
  1. Erase the content, then press Update

*Spoiler alert: The content is still there*

  1. Add a title
  1. Repeat steps 3 & 4

*Works*

This is important because some post formats don't need a title

Attachments (2)

23623.diff (891 bytes) - added by wonderboymusic 11 years ago.
23623.2.diff (891 bytes) - added by markjaquith 11 years ago.
Same, but removed 'link'

Download all attachments as: .zip

Change History (11)

#1 @wonderboymusic
11 years ago

  • Description modified (diff)

#2 follow-up: @azaozz
11 years ago

Thinking this should go the other way: the default posts can be without a title, but shouldn't be without content, i.e. saving or publishing a post of type 'post' or 'page' without content should be rejected.

#3 @SergeyBiryukov
11 years ago

  • Component changed from General to Post Types
  • Version changed from trunk to 2.1

Publishing is not necessary, reproduced with saving as a draft it as well.

Caused by $maybe_empty check in wp_insert_post():
http://core.trac.wordpress.org/browser/tags/3.5.1/wp-includes/post.php#L2727

Related: [4147] (for #2390), [19305] (for #18713), #17115.

#5 @wonderboymusic
11 years ago

  • Keywords has-patch added

Fixes this issue using similar technique from #23887

#6 in reply to: ↑ 2 @markjaquith
11 years ago

Replying to azaozz:

Thinking this should go the other way: the default posts can be without a title, but shouldn't be without content, i.e. saving or publishing a post of type 'post' or 'page' without content should be rejected.

Thoroughly disagree. I use no-content posts all the time (say, to act as a page stub for a plugin to act upon).

@markjaquith
11 years ago

Same, but removed 'link'

#7 @markjaquith
11 years ago

.2.diff removes "link" — if you don't have a title or content, there's nothing to wrap the link around.

#8 @markjaquith
11 years ago

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

In 23986:

Allow the content of no-title audio, video, quote, and image posts to be blanked.

props wonderboymusic. fixes #23623.

#9 @azaozz
11 years ago

I use no-content posts all the time (say, to act as a page stub for a plugin to act upon).

Right, have used that too. Wondering if we need to be looking at the post format meta fields when determining whether a post is "empty". For example: saving a video post with empty wp_format_video meta and no title or content.

Note: See TracTickets for help on using tickets.