Ticket #5927 (closed defect: fixed)

Opened 9 months ago

Last modified 9 months ago

Media library not working

Reported by: jhodgdon Assigned to: ryan
Priority: normal Milestone: 2.5
Component: Administration Version: 2.5
Severity: critical Keywords: media has-patch
Cc:

Description

In [6914], the Manage / Media Library screen is broken, in several ways. Some of these could be problems with the Upload windows accessible from the Post Edit screen, I am not sure of the causes.

a) If I upload a file using the single-image upload/insert window from the Post Edit screen, it shows up in the Media Library as not attached to a particular post. (To be more specific, in the "Appears With" column, it shows "(no title)" and the link goes to post=0.) If I use the Gallery window to upload, it shows up as attached to a post.

b) The times are wrong. I uploaded a file, then visited the Media Library screen just a minute or two later, and it told me the uploads happened 58-60 minutes ago. If I refresh a few minutes later, it says 55 minutes ago.

c) The delete functionality doesn't work. I check one or more boxes (tried with just one; tried with several) and click the Delete button, and I get a screen with title "WordPress Failure Notice" saying "Are you sure you want to do this?" with a link saying "Try again", which just takes me back to the Media Library screen (and nothing has been deleted).

Attachments

5927.diff (1.1 kB) - added by andy on 02/22/08 22:06:49.
removes future dates and fixes phantom titles

Change History

02/19/08 20:32:05 changed by ryan

  • owner changed from anonymous to andy.

02/22/08 22:06:49 changed by andy

  • attachment 5927.diff added.

removes future dates and fixes phantom titles

02/22/08 22:07:13 changed by andy

  • keywords changed from media to media has-patch.
  • owner changed from andy to ryan.

02/22/08 22:38:52 changed by ryan

  • status changed from new to closed.
  • resolution set to fixed.

(In [6988]) Date and title fixes for media management from andy. fixes #5927

02/23/08 16:19:07 changed by jhodgdon

  • status changed from closed to reopened.
  • resolution deleted.

I retested today in [6994].

(a) -- fixed due to changes in the media upload section

(b) -- The times are still wrong -- I uploaded files about 10-15 minutes ago, and the screen says "48 minutes from now". It's probably a time zone issue? My server's current time is 8:08 AM, but on the General Settings tab, it shows the current time is 9:08 AM. The Post Date field on the file's entry in the wp_posts table is set to 8:55 AM, which to me suggests the Media Library should show it was uploaded 13 minutes ago, not 48 minutes in the future. Comparing GMT, the General Settings screen thinks it is currently 16:08 GMT, and the posts table says the file was uploaded at 15:55 GMT, again 13 minutes ago. Anyway, maybe I'll investigate this, but there's some time logic problem.

(c) -- delete has been fixed

Since the times are still wrong, I am reopening this ticket.

02/23/08 16:32:24 changed by jhodgdon

I think the problem with the times is in wp-admin/edit-attachment-rows.php. It is getting the post time using the get_post_time() function, which gets it from the post table (which I think is set according to the time zone setting in General Options).

Then it is comparing that time to the PHP function time(), which gets the time according to the server where PHP is running, ignoring the time zone settings. Hence the 1 hour discrepancy on my test setup, where the server is an hour off my General Settings time zone setting.

Probably it would be best to compare GMT to GMT to figure out the relative human time difference. I'll submit a quick patch.

02/23/08 16:44:36 changed by jhodgdon

Hmmm... One correction: the PHP function time() actually gets the absolute Unix timestamp, which is number of seconds since the 1/1/1970, midnight GMT.

I'll have to play around with this a bit more to figure out what is going on and how to fix it.

02/23/08 17:24:03 changed by jhodgdon

  • status changed from reopened to closed.
  • resolution set to fixed.

OK, this problem with the "60 minutes ago" affects other screens (post manage and page manage). I'll file a separate bug and close this one back up.

02/23/08 17:55:52 changed by jhodgdon

The other bug I posted on the human time differences is #5970.