Opened 15 years ago
Closed 15 years ago
#11052 closed defect (bug) (fixed)
Cannot trash Media without title
Reported by: | 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)
Change History (7)
#3
follow-up:
↓ 4
@
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
@
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.
Odd. The problem seems to be in wp_insert_post, but I'm not sure exactly what it is...