Opened 17 years ago
Closed 17 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 )
wp-app.php handles "published" element incorrectly on PUT
Looks like a typo. Patch attached.
Attachments (2)
Change History (17)
#1
@
17 years ago
This bug is preventing atompub clients from being able to update timestamps on already published entries.
#2
@
17 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
#6
@
17 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.
#7
@
17 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.
#8
follow-up:
↓ 9
@
17 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.
#9
in reply to:
↑ 8
;
follow-up:
↓ 10
@
17 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.
#10
in reply to:
↑ 9
;
follow-up:
↓ 11
@
17 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.
#11
in reply to:
↑ 10
@
17 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.
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.
#13
in reply to:
↑ 5
;
follow-up:
↓ 14
@
17 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.
#14
in reply to:
↑ 13
@
17 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.
Patch to fix what looks like a typo preventing <published> handling on PUT