WordPress.org

Make WordPress Core

Opened 8 years ago

Closed 7 years ago

#5680 closed defect (bug) (fixed)

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

Reported by: tvachon Owned by: westi
Milestone: 2.5 Priority: normal
Severity: normal Version: 2.5
Component: General Keywords: has-patch
Focuses: Cc:

Description (last modified by lloydbudd)

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

Looks like a typo. Patch attached.

Attachments (2)

wp-app-published.patch (444 bytes) - added by tvachon 8 years ago.
Patch to fix what looks like a typo preventing <published> handling on PUT
ticket_5680.patch (3.0 KB) - added by rubys 8 years ago.
Allow AtomPub to update the updated/modified date for entries

Download all attachments as: .zip

Change History (17)

@tvachon8 years ago

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

comment:1 @tvachon8 years ago

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

comment:2 @lloydbudd8 years ago

  • Cc rubys added
  • Description modified (diff)
  • Keywords has-patch added
  • Milestone changed from 2.6 to 2.5
  • Version set to 2.5

comment:3 @westi8 years ago

  • Owner changed from anonymous to westi
  • Status changed from new to assigned

comment:4 @westi8 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

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

comment:5 follow-up: @rubys8 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

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...

comment:6 @tvachon8 years ago

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.

@rubys8 years ago

Allow AtomPub to update the updated/modified date for entries

comment:7 @rubys8 years ago

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.

comment:8 follow-up: @ryan8 years ago

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.

comment:9 in reply to: ↑ 8 ; follow-up: @rubys8 years ago

  • 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.

comment:10 in reply to: ↑ 9 ; follow-up: @DD328 years ago

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/

comment:11 in reply to: ↑ 10 @lloydbudd8 years ago

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.

comment:12 @westi8 years ago

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

comment:13 in reply to: ↑ 5 ; follow-up: @bentrem7 years ago

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.

comment:14 in reply to: ↑ 13 @rubys7 years ago

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.

comment:15 @ryan7 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed
Note: See TracTickets for help on using tickets.