Make WordPress Core

Opened 15 years ago

Closed 15 years ago

#11052 closed defect (bug) (fixed)

Cannot trash Media without title

Reported by: simek's profile Simek Owned by:
Milestone: 2.9 Priority: normal
Severity: normal Version: 2.9
Component: Trash Keywords: has-patch commit
Focuses: Cc:

Description

Tested on various files.

This problem only exist if file has non-required title field (for ex. PDF, TXT). After upload and delete title new media is added to library with "(no title)" caption in media browser. Until we'll add a title in edit media page this media cannot be deleted in normal and bulk way. Page reload, notification appears, but nothing happened.

Attachments (1)

11052.diff (545 bytes) - added by caesarsgrunt 15 years ago.

Download all attachments as: .zip

Change History (7)

#1 @ryan
15 years ago

  • Component changed from Media to Trash

#2 @caesarsgrunt
15 years ago

Odd. The problem seems to be in wp_insert_post, but I'm not sure exactly what it is...

@caesarsgrunt
15 years ago

#3 follow-up: @caesarsgrunt
15 years ago

  • Keywords has-patch added; needs-patch removed

The problem is with lines 1613-1618 of wp-includes/post.php, in wp_insert_post(). They throw an error if the content, title, and excerpt are all empty, which has he effect of making it impossible to update (eg trash) an attachment without a title. I don't know what the purpose of these lines is... but my patch fixes the problem by making it not throw the error if the post is an attachment.

#4 in reply to: ↑ 3 @nacin
15 years ago

Replying to caesarsgrunt:

The problem is with lines 1613-1618 of wp-includes/post.php, . . . I don't know what the purpose of these lines is...

I tracked down that code as originating in http://core.trac.wordpress.org/ticket/2390. The excerpt check was added some revisions later.

#5 @caesarsgrunt
15 years ago

  • Keywords commit added

Ah; thanks nacin.

Now, if someone would commit the patch...

#6 @automattor
15 years ago

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

(In [12273]) Don't require titles for attachments. Props caesarsgrunt. fixes #11052

Note: See TracTickets for help on using tickets.