Ticket #5680 (closed defect: fixed)

Opened 10 months ago

Last modified 9 months ago

wp-app.php handles "updated" element incorrectly on PUT

Reported by: tvachon Assigned to: westi
Priority: normal Milestone: 2.5
Component: General Version: 2.5
Severity: normal Keywords: has-patch
Cc: rubys

Description (Last modified by lloydbudd)

wp-app.php handles "published" element incorrectly on PUT

Looks like a typo. Patch attached.

Attachments

wp-app-published.patch (444 bytes) - added by tvachon on 01/17/08 06:37:54.
Patch to fix what looks like a typo preventing <published> handling on PUT
ticket_5680.patch (3.0 kB) - added by rubys on 01/21/08 23:23:09.
Allow AtomPub? to update the updated/modified date for entries

Change History

01/17/08 06:37:54 changed by tvachon

  • attachment wp-app-published.patch added.

Patch to fix what looks like a typo preventing <published> handling on PUT

01/17/08 06:40:34 changed by tvachon

This bug is preventing atompub clients from being able to update timestamps on already published entries.

01/18/08 00:14:56 changed by lloydbudd

  • cc set to rubys.
  • keywords set to has-patch.
  • version set to 2.5.
  • description changed.
  • milestone changed from 2.6 to 2.5.

01/18/08 07:52:55 changed by westi

  • owner changed from anonymous to westi.
  • status changed from new to assigned.

01/18/08 07:59:09 changed by westi

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

(In [6635]) Ensure APP clients can update timestamps on publish. Fixes #5680 props tvachon.

(follow-up: ↓ 13 ) 01/18/08 13:33:06 changed by rubys

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

With this change in place, APE now reports an error:

! In entry with title 'Entry Mini-4', app:edited values out of order, d Fri Jan 18 13:15:36 UTC 2008 ld Fri Jan 18 13:15:27 UTC 2008.
! Entries feed out of order after update of multi-post.

Investigating...

01/18/08 19:24:32 changed by tvachon

From rfc 4289:

The "atom:published" element is a Date construct indicating an instant in time associated with an event early in the life cycle of the entry.

vs.

The "atom:updated" element is a Date construct indicating the most recent instant in time when an entry or feed was modified in a way the publisher considers significant.

which, IMHO), corresponds better to "changing the timestamp" of an entry.

It looks like [6635] allows for this well, with line 335 changing from

$pubtimes = $this->get_publish_time($parsed->published);

to

$pubtimes = $this->get_publish_time($parsed->updated);

I haven't tested out APE with this change in place, but I'll give it a shot when I get a chance.

01/21/08 23:23:09 changed by rubys

  • attachment ticket_5680.patch added.

Allow AtomPub? to update the updated/modified date for entries

01/21/08 23:23:39 changed by rubys

I've attached a patch that I'm comfortable with. It reverts the above change for the reason that "tvachon" gives above... published is meant to be early in the publishing cycle, so is not the way to signal a change. It then adds the ability to change what Atom calls the updated time (internally, Wordpress tracks this as post_modified and post_modified_gmt).

With this patch, Ape tests pass again.

(follow-up: ↓ 9 ) 01/22/08 06:45:04 changed by ryan

Looks like wp_update_post() always sets the modified times to the current time when updating.

	if ( $update ) {
		$post_modified     = current_time( 'mysql' );
		$post_modified_gmt = current_time( 'mysql', 1 );
	}

Seems that passing post_modified and post_modified_gmt to wp_update_post() wouldn't actually do anything.

(in reply to: ↑ 8 ; follow-up: ↓ 10 ) 01/22/08 09:52:11 changed by rubys

  • summary changed from wp-app.php handles "published" element incorrectly on PUT to wp-app.php handles "updated" element incorrectly on PUT.

Replying to ryan:

Seems that passing post_modified and post_modified_gmt to wp_update_post() wouldn't actually do anything.

I have yet to figure out why that code is not working, but if you look here and scroll down a bit you will see a number of entries with 1999-11-30T00:00:00Z timestamps. I don't know where that date is coming from. With this patch, post_modified and post_modified_gmt get passed to wp_update_post() and are stored properly.

The last I heard, the next release of WordPress was scheduled for the end of January. I don't know if that has moved, but I would like to request that either this patch be included or the previous patch be backed out before the release is made.

I'm also changing the summary.

(in reply to: ↑ 9 ; follow-up: ↓ 11 ) 01/22/08 10:16:24 changed by DD32

Replying to rubys:

The last I heard, the next release of WordPress was scheduled for the end of January.

2.4 will be skipped, 2.5 is the next release.

http://wordpress.org/about/roadmap/

(in reply to: ↑ 10 ) 01/22/08 14:11:08 changed by lloydbudd

Replying to rubys:

I don't know if that has moved, but I would like to request that either this patch be included or the previous patch be backed out before the release is made.

rubys, I think you are correct, that is a good first step, if there are lingering concerns with your patch. Ryan or Westi can you commit:

svn merge -r6635:6634 http://svn.automattic.com/wordpress/trunk

Replying to DD32:

2.4 will be skipped, 2.5 is the next release. http://wordpress.org/about/roadmap/

Hmm, that still lists 2.4 . I've sent a note reminding Matt. http://trac.wordpress.org/roadmap has been updated for some time, but of course 2.5 date is written in sand.

01/23/08 20:25:08 changed by westi

(In [6645]) Fix the updated times when publishing/editing with APP. See #5680 props rubys.

(in reply to: ↑ 5 ; follow-up: ↓ 14 ) 02/04/08 18:58:31 changed by bentrem

Replying to rubys:

With this change in place, APE now reports an error: "In entry with title 'Entry Mini-4', app:edited values out of order, d Fri Jan 18 13:15:36 UTC 2008"

I'm looking at that report on interwingly. "app:edited values out of order" does not exist. And the report presented there is Sat, 02 Feb 2008 21:07:25.

No indication on that page of what fault was identified.

(in reply to: ↑ 13 ) 02/04/08 19:09:05 changed by rubys

Replying to bentrem:

Replying to rubys:

With this change in place, APE now reports an error: "In entry with title 'Entry Mini-4', app:edited values out of order, d Fri Jan 18 13:15:36 UTC 2008"

I'm looking at that report on interwingly. "app:edited values out of order" does not exist. And the report presented there is Sat, 02 Feb 2008 21:07:25.

I provided a patch on 21 Jan 2008 which corrected that particular problem, and seemed to also address the issue described by this ticket. This patch was applied on 23 Jan 2008. The URI I provided is captured output from runs that I make every hour that there happens to be a commit to the WP SVN.

Ryan noted that on 22 Jan 2008 that the patch I supplied shouldn't work, and in fact I can't explain why it appears to.

02/26/08 09:02:16 changed by ryan

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