WordPress.org

Make WordPress Core

#23887 closed defect (bug) (fixed)

Some Post Formats seen as "empty" but shouldn't

Reported by: WraithKenny Owned by: markjaquith
Milestone: 3.6 Priority: high
Severity: critical Version: 3.6
Component: Post Formats Keywords: has-patch commit
Focuses: Cc:

Description

In wp_insert_post, there's a $maybe_empty check to see if title, content, or excerpt is not empty, and won't save if all are empty. Some Post formats don't require any of these fields.

Attachments (2)

23887.patch (816 bytes) - added by WraithKenny 13 months ago.
23887.2.patch (784 bytes) - added by SergeyBiryukov 12 months ago.

Download all attachments as: .zip

Change History (17)

WraithKenny13 months ago

comment:1 WraithKenny13 months ago

  • Keywords has-patch added

error logs show:

[29-Mar-2013 04:47:00 UTC] 1

Not. Helpful. :-/
Anyway, patch lets you save some post formats ('audio', 'video', 'quote', 'image', 'link') without title, content or excerpt.

comment:2 SergeyBiryukov13 months ago

#23892 was marked as a duplicate.

comment:3 SergeyBiryukov13 months ago

  • Priority changed from normal to high
  • Severity changed from normal to critical

Related: #17115, #23623

comment:4 SergeyBiryukov13 months ago

  • Milestone changed from Awaiting Review to 3.6

comment:5 WraithKenny13 months ago

Some notes on this:

When you submit an edit, with no title, content, or excerpt, the post doesn't save (autosave does, since it has a placeholder title)... but there's supposed to be an error message. The error message doesn't show; instead you get the published, view post message. (see #17115)

Also, The patch I submitted let's you save the post formats I listed (not a vetted list tho) even without title, content, or excerpt, but the patch is incomplete as it doesn't check if the appropriate meta is empty or not. (::TODO::) See 23859 for similar logic but perhaps needs format by format checks.

comment:6 DrewAPicture13 months ago

We should probably generate some kind of non-int title regardless of whether the post actually needs one.

It's up to themes to handle whether these types of post format posts will have a single view, and if they do, we need to take #5305 into account. IIRC, @alexkingorg covered this case in his original Post Formats UI concept and plugin.

comment:7 helen13 months ago

Mentioned the title thing in my last Make/Core update:

Titles need to be filled in based on content for those formats, a la P2. Might be nice to try to do something smart with image, like detecting an alt or title attribute for the fill-in, but at the very least, something better than (no title) or Auto Draft.

comment:8 davidwilliamson13 months ago

#23957 was marked as a duplicate.

comment:9 SergeyBiryukov13 months ago

#23978 was marked as a duplicate.

comment:11 SergeyBiryukov13 months ago

#24037 was marked as a duplicate.

comment:12 wonderboymusic13 months ago

  • Keywords commit added

We need to commit this- #23623 is problematic as well

comment:13 markjaquith13 months ago

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

Looks like the patch was the same as for #23623


In [23986]:

Allow the content of no-title audio, video, quote, and image posts to be blanked.
props wonderboymusic. fixes #23623.

SergeyBiryukov12 months ago

comment:14 SergeyBiryukov12 months ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

There's still a problem with deleting image posts without a title (see ticket:24046:15). We don't have the format context in wp-admin/post.php after clicking the Delete link.

Looks like get_post_format() (from 23887.patch) would be the correct solution here. Refreshed.

comment:15 markjaquith12 months ago

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

In 24015:

Use get_post_format() instead of assuming we already have it.

  • Fixes an issue where image posts without a title could not be deleted

fixes #23887. see #24046. props WraithKenny, SergeyBiryukov.

Note: See TracTickets for help on using tickets.