#5927 closed defect (bug) (fixed)
Media library not working
| Reported by: | jhodgdon | Owned by: | ryan |
|---|---|---|---|
| Priority: | normal | Milestone: | 2.5 |
| Component: | Administration | Version: | 2.5 |
| Severity: | critical | Keywords: | media has-patch |
| Cc: | Focuses: |
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 (1)
Change History (9)
#4
@
19 years ago
- Resolution fixed
- Status closed → reopened
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.
#5
@
19 years ago
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.
#6
@
19 years ago
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.
removes future dates and fixes phantom titles