WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 10 months ago

#10752 closed defect (bug) (wontfix)

Uploading new media to existing posts/pages backdates file location

Reported by: dpie Owned by:
Milestone: Priority: normal
Severity: minor Version: 2.8.4
Component: Media Keywords: needs-patch
Focuses: Cc:

Description

Using WP 2.8.4, when uploading new media files to a page or post that has already been published, the new file is added in the /UPLOAD_DIR/year/month/ directory that corresponds to the original page/post publication date, rather than the file upload date.

Also, the correct file-upload-date-based directory is created (if it does not already exist), but the file is still placed in the older incorrect directory.

Example: Assume the following...

On /wp-admin/options-misc.php:

  • "Store uploads in this folder" (referred to above as UPLOAD_DIR) is set to "wp-content/uploads" or any other location, such as "files"
  • "Organize my uploads into month- and year-based folders" is checked

On an existing Page:

  • Page has a published date of 3/1/2008
  • File a_test_file.jpg is uploaded on 9/1/2009
  • UPLOAD_DIR is set to "wp-content/uploads", has 777 permissions, and contains no subdirectories or files

WordPress 2.6.x and below would have created the following:

  • /wp-content/uploads/2009/09/a_test_file.jpg

However, WP 2.8.4 is creating:

  • /wp-content/uploads/2008/03/a_test_file.jpg
  • /wp-content/uploads/2009/09

This issue was previously mentioned on the wordpress.org forums as being a known issue with WP 2.7.1: http://wordpress.org/support/topic/254786

Change History (8)

comment:1 follow-up: @azaozz5 years ago

This is actually a "feature" (can't find the ticket at the moment). Attachments are stored by the parent post date.

comment:2 @scribu5 years ago

  • Keywords 2nd-opinion added; media file upload removed

comment:3 in reply to: ↑ 1 ; follow-up: @dpie5 years ago

Replying to azaozz:

This is actually a "feature" (can't find the ticket at the moment). Attachments are stored by the parent post date.

Even if this is the new standard WP attachment behavior, the upload should not be creating an empty directory for the current year+month.

Using the publication date rather than the file upload date might make sense for a timestamped Post, but it doesn't make sense for years-old Pages (in which the pub date is largely irrelevant).

comment:4 @nacin5 years ago

  • Milestone changed from Unassigned to 3.1

comment:5 @nacin4 years ago

  • Keywords needs-patch added; 2nd-opinion removed
  • Milestone changed from Awaiting Triage to Future Release

the upload should not be creating an empty directory for the current year+month.

needs-patch

comment:6 in reply to: ↑ 3 @cathlaura3 years ago

  • Cc cathlaura added

Replying to dpie:

Even if this is the new standard WP attachment behavior, the upload should not be creating an empty directory for the current year+month.

Using the publication date rather than the file upload date might make sense for a timestamped Post, but it doesn't make sense for years-old Pages (in which the pub date is largely irrelevant).

Could this be turned into 2 tickets? One is a bug - the empty directory being created. Two is a feature request - it'd be great if under Media Settings you could choose whether you wanted media uploads backdated to the publication date of the post/page they're attached to. Could separate out the options, so that you could e.g. backdate on posts but not on pages.

comment:7 @scribu3 years ago

"choose whether you wanted media uploads backdated to the publication date of the post/page they're attached to"

That sounds like a very arcane option that most users won't care about. Let's not do that.

comment:8 @wonderboymusic10 months ago

  • Milestone Future Release deleted
  • Resolution set to wontfix
  • Status changed from new to closed

No one has touched this in almost 2 years. I can't imagine this being a widely requested feature.

Note: See TracTickets for help on using tickets.