I noticed in _entries that the timestamp field contains yesterdays date, but last_modified contains the date from two weeks ago. I'm not sure if the fix for this is that last_modified should be updated when the timestamp is updated, or that the rss syndicate plugin needs to pull timestamp as the pubDate... any thoughts?
Improper pubDate for feed in rss2.0
Improper pubDate for feed in rss2.0
My scenario is that I wrote a blog post about 2 weeks ago but left it as draft. I published a few articles since then. When I went to publish it yesterday, I updated the time to be the current date so that it would be the latest entry. On my website, it is the first entry, and when I look in my rss feed it is also the first entry, however my rss feed has picked up the original date of the post as the pubDate for the feed (coming from syndicate plugin), meaning all of the blogg aggregators think my feed is two weeks old and wont update 
I noticed in _entries that the timestamp field contains yesterdays date, but last_modified contains the date from two weeks ago. I'm not sure if the fix for this is that last_modified should be updated when the timestamp is updated, or that the rss syndicate plugin needs to pull timestamp as the pubDate... any thoughts?
I noticed in _entries that the timestamp field contains yesterdays date, but last_modified contains the date from two weeks ago. I'm not sure if the fix for this is that last_modified should be updated when the timestamp is updated, or that the rss syndicate plugin needs to pull timestamp as the pubDate... any thoughts?
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: Improper pubDate for feed in rss2.0
Hi!
Which serendipity version are you using? Usually when you save a published entry, the last_modified date should get updated.
In your case, if you only saved the draft and go to publish, then serendipity does intentionally not push the last_modified date, to preserve the original timestamp. So, actually all you should need to do is to save your current entry once again, and then last_modified should be updated to the latest timestamp.
Best regards,
Garvin
Which serendipity version are you using? Usually when you save a published entry, the last_modified date should get updated.
In your case, if you only saved the draft and go to publish, then serendipity does intentionally not push the last_modified date, to preserve the original timestamp. So, actually all you should need to do is to save your current entry once again, and then last_modified should be updated to the latest timestamp.
Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
This is using s9y 1.0.
I actually did try to modify the entry to update the last_modified date, but for some reason it didnt change the last_modified date at all. Unless there is some logic in the code the checks the amount of change before updating last modified, this probably means there is some other bug going on in there, but thinking about it further, I don;t think that is the right solution anyway...
To me the problem is that the blog pubDate is being populated by a different field than the individual entry pubDates. Since the individual entries in the rss feed and the website display itself all base thier publish dates based on the timestamp field, istm that the overall feed pubdate should also use this field so that all three items are in synch... am I missing something there?
simple change makes the above happen:
*** include/plugin_internal.inc.php 2006-08-17 07:04:46.000000000 -0700
--- include/plugin_internal.inc.php.rht 2006-08-17 07:05:47.000000000 -0700
***************
*** 1010,1016 ****
switch($match[1]) {
case 'pubDate':
if (serendipity_db_bool($bag_content)) {
! $bag_content = gmdate('D, d M Y H:i:s \G\M\T', serendipity_serverOffsetHour($entries[0]['last_modified']));
} else {
$bag_content = '';
}
--- 1010,1016 ----
switch($match[1]) {
case 'pubDate':
if (serendipity_db_bool($bag_content)) {
! $bag_content = gmdate('D, d M Y H:i:s \G\M\T', serendipity_serverOffsetHour($entries[0]['timestamp']));
} else {
$bag_content = '';
}
I actually did try to modify the entry to update the last_modified date, but for some reason it didnt change the last_modified date at all. Unless there is some logic in the code the checks the amount of change before updating last modified, this probably means there is some other bug going on in there, but thinking about it further, I don;t think that is the right solution anyway...
To me the problem is that the blog pubDate is being populated by a different field than the individual entry pubDates. Since the individual entries in the rss feed and the website display itself all base thier publish dates based on the timestamp field, istm that the overall feed pubdate should also use this field so that all three items are in synch... am I missing something there?
simple change makes the above happen:
*** include/plugin_internal.inc.php 2006-08-17 07:04:46.000000000 -0700
--- include/plugin_internal.inc.php.rht 2006-08-17 07:05:47.000000000 -0700
***************
*** 1010,1016 ****
switch($match[1]) {
case 'pubDate':
if (serendipity_db_bool($bag_content)) {
! $bag_content = gmdate('D, d M Y H:i:s \G\M\T', serendipity_serverOffsetHour($entries[0]['last_modified']));
} else {
$bag_content = '';
}
--- 1010,1016 ----
switch($match[1]) {
case 'pubDate':
if (serendipity_db_bool($bag_content)) {
! $bag_content = gmdate('D, d M Y H:i:s \G\M\T', serendipity_serverOffsetHour($entries[0]['timestamp']));
} else {
$bag_content = '';
}
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi!
Yes, the channel's pubdate is identical to the timestamp of any last update to a s9y entry, which will push the Conditonal Get caching of an RSS feed to refresh, when an existing entry is changed.
Best regards,
Garvin
Yes, the channel's pubdate is identical to the timestamp of any last update to a s9y entry, which will push the Conditonal Get caching of an RSS feed to refresh, when an existing entry is changed.
How did you do that?I actually did try to modify the entry to update the last_modified date
Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
RIght, but the thing is that if you change the timestamp of a given entry, you will change the order of entries in both your website and your rss feed, which to me means you should probably also send a note for people to come and grab your feed again no?garvinhicking wrote:Hi!
Yes, the channel's pubdate is identical to the timestamp of any last update to a s9y entry, which will push the Conditonal Get caching of an RSS feed to refresh, when an existing entry is changed.
I guess the central question is does change a time on a blog entry mean you have updated your content, and therfore you should tell blog readers to refresh the feed. I think it does.
In the entry I changed some text from HTH to hope this helps. I thought saving that text change would have been enough to cause the last_updated column to be modified., but it didn't change it.How did you do that?I actually did try to modify the entry to update the last_modified date
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi!

Best regards,
Garvin
Yes, which is why serendipity also pushes the last_modified timestamp when you save a published entry and change things like the timestamp.RIght, but the thing is that if you change the timestamp of a given entry, you will change the order of entries in both your website and your rss feed, which to me means you should probably also send a note for people to come and grab your feed again no?
Was that entry a draft or a published one? Could you try it with an entry that is more recent (not older than 5 days) and see if that updates the last_modified timestamp? Actually it should.In the entry I changed some text from HTH to hope this helps. I thought saving that text change would have been enough to cause the last_updated column to be modified., but it didn't change it.
Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Well then I guess I have a bug going on here, because mine is not updating last_modified when I update the timestamp.garvinhicking wrote:Hi!
Yes, which is why serendipity also pushes the last_modified timestamp when you save a published entry and change things like the timestamp.RIght, but the thing is that if you change the timestamp of a given entry, you will change the order of entries in both your website and your rss feed, which to me means you should probably also send a note for people to come and grab your feed again no?
No. I tried it with one that was 3 days old and i get the same behavior.Was that entry a draft or a published one? Could you try it with an entry that is more recent (not older than 5 days) and see if that updates the last_modified timestamp? Actually it should.In the entry I changed some text from HTH to hope this helps. I thought saving that text change would have been enough to cause the last_updated column to be modified., but it didn't change it.![]()
(time elapses)
And now I have tried it with a brand new draft entry and it still doesn't update the last modified time.
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi!
1. You create a draft entry. Date it to like 2006-08-19.
2. You wait a day.
3. You publish your draft entry. Time will stick at 2006-08-19, timestamp as well.
4. You wait a day.
5. You modify your now public entry. Save it. Then the timestamp will stay at 2006-08-19, but last_modified should then be set to 2006-08-21?
Best regards,
Garvin
You mean you do that:And now I have tried it with a brand new draft entry and it still doesn't update the last modified time.
1. You create a draft entry. Date it to like 2006-08-19.
2. You wait a day.
3. You publish your draft entry. Time will stick at 2006-08-19, timestamp as well.
4. You wait a day.
5. You modify your now public entry. Save it. Then the timestamp will stay at 2006-08-19, but last_modified should then be set to 2006-08-21?
Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
I finally had some time to investigate, and I think the problem comes from this change in includes/functions_entries.inc.php
http://svn.berlios.de/wsvn/serendipity/ ... v=756&sc=1
specifically, the check for isdraft -->
if ($entry['isdraft'] === 'false' && $_entry['isdraft'] === 'false') {
$entry['last_modified'] = time();
}
$_entry['isdraft'] actually returns f, which afaict will not validate above, and so the last modified time never updates. I think this might be a postgresql issue, since returning f is a libpqism afaik. Changing this to === 'f' seems to make things work properly again. Any thoughts? Any other pg users notice this problem?
http://svn.berlios.de/wsvn/serendipity/ ... v=756&sc=1
specifically, the check for isdraft -->
if ($entry['isdraft'] === 'false' && $_entry['isdraft'] === 'false') {
$entry['last_modified'] = time();
}
$_entry['isdraft'] actually returns f, which afaict will not validate above, and so the last modified time never updates. I think this might be a postgresql issue, since returning f is a libpqism afaik. Changing this to === 'f' seems to make things work properly again. Any thoughts? Any other pg users notice this problem?
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi!
Please mention everytime that you are using postgresql.
Postgresql behaves so wickedly different in many cases like the one here, where I don't know further. It would've helped us some time *g*
It might work with this code:
Best regards,
Garvin
Please mention everytime that you are using postgresql.
Postgresql behaves so wickedly different in many cases like the one here, where I don't know further. It would've helped us some time *g*
It might work with this code:
Code: Select all
if (!serendipity_db_bool($entry['isdraft']) && !serendipity_db_bool($_entry['isdraft'])) {
$entry['last_modified'] = time();
}
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/