Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#25051 closed defect (bug) (fixed)

Wrong time displayed for restored posts

Reported by: pavelevap's profile pavelevap Owned by: nacin's profile nacin
Milestone: 3.6.1 Priority: normal
Severity: normal Version: 3.6
Component: Revisions Keywords: has-patch fixed-major
Focuses: Cc:

Description

There is a message "Previously restored by..." displayed in Revisions admin metabox when post was restored. Value for $time_diff is right, but $date is wrong. It shows current date everytime and not the date of restoration. Problem is related to $restored_from_meta[ 'restored_time' ] which is Unix timestamp and not string. So, strtotime() does not make sense here...

Attached is a simple patch to illustrate described issue. It works for me, but I am not familiar with date/time functions, maybe there is better solution...

Attachments (2)

restoration.time.patch (829 bytes) - added by pavelevap 11 years ago.
25051.patch (732 bytes) - added by SergeyBiryukov 11 years ago.

Download all attachments as: .zip

Change History (14)

#1 @SergeyBiryukov
11 years ago

  • Milestone changed from Awaiting Review to 3.7

#2 @vinod dalvi
11 years ago

  • Cc mozillavvd@… added

#3 @nacin
11 years ago

  • Milestone changed from 3.7 to 3.6.1

#4 @vinod dalvi
11 years ago

  • Keywords has-patch added

#5 @nacin
11 years ago

Per IRC, the plan here is to actually remove this whole section of the revisions box. It's ugly, not very useful, and is in a box we want to get rid of anyway. We're not going to prevent collecting the data, just remove the UI.

#6 @adamsilverstein
11 years ago

  • Cc adamsilverstein@… added

#7 @nacin
11 years ago

In 25194:

Remove display of 'Previously restored by' in the revisions meta box as it is busted.

Fixes invalid markup (missing closing ul tag) when there was no previously restored revision.

see #25051 for trunk.

#8 @nacin
11 years ago

  • Keywords fixed-major added

#9 @nacin
11 years ago

From IRC:

Sergey: What's the plan for 3.6 on #25051? restoration.time.patch seems fine, should I test it?

Nacin: I think it should be what I committed ([25194]), but if the patch works, I guess we can just do that. (also need to move the </ul> out from the if statement.)

#10 @SergeyBiryukov
11 years ago

We could probably keep date_i18n(), see 25051.patch. But I'm fine with [25194] too.

#11 @pavelevap
11 years ago

Yes, removing the whole section is the best option, I guess (also for 3.6.1).

#12 @nacin
11 years ago

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

In 25233:

Remove display of 'Previously restored by' in the revisions meta box as it is busted.

Fixes invalid markup (missing closing ul tag) when there was no previously restored revision.

Merges [25194] to the 3.6 branch.
fixes #25051.

Note: See TracTickets for help on using tickets.