Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2010-08-20 10:38:33
- edmungo
- Member
- Registered: 2006-07-10
- Posts: 12
Recent Articles wrong - shows future articles based on Posted date
Anyone know a fix for the Recent Articles list (admin side) not showing the correct items because it lists articles based on posted date when an article is post-dated and unmodified?
Say I create a new article, set the posted date to next year and save it. In the admin side it shows no modification date (this is different to 4.0.8 where the mod date was initially set to the date of creation). Then I create ten more articles post-dated next year and they all appear on my Recent Articles list. Okay so far. But then I edit an old article posted last week, after which I expect that article to be at the top of my Recent Articles list – it was the last article I modified and its modification date is today, it should be top of the list of Recent Articles. But it doesn’t appear on the list at all because the list is full of post-dated articles (articles I haven’t modified at all since their creation and don’t appear to have a modification date).
This is a problem introduced in 4.2. Either new post-dated articles have their modification dates wrongly set to the posted date, rather than the date the article was created, or whatever function produces the Recent Articles list is defaulting to the posted date when there’s no modification date. Either way it’s a bug and a pain in the neck, as the recent articles list is extremely useful.
Offline
#2 2010-10-12 01:06:32
- zeusdidit
- Member
- Registered: 2007-10-16
- Posts: 111
Re: Recent Articles wrong - shows future articles based on Posted date
I’m having the same issue. I’m looking for a plugin now to resolve. Will post if I find an answer, but so far haven’t found anything…
Offline
Re: Recent Articles wrong - shows future articles based on Posted date
Hmm, you’re right. I missed your post first time round. That is bizarre. The change came in r3172 early last year and it looks like it was done intentionally.
We’d have to scrape through Robert’s brain to find the reason behind this alteration. If it fixed some other behavioural oddness and we can’t alter it so that it uses today’s date as the LastMod date on article creation if the Posted date is > today, then the only remaining avenue is to try and figure out a way of altering the Recent Articles list. But quite how we’d get it to ignore the LastMod of future dated articles only if they haven’t been modded since creation is beyond my SQL knowledge without sitting down and applying some deep thought.
Hopefully Robert or someone else can shed some light on this one.
Last edited by Bloke (2010-10-12 09:48:44)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
Re: Recent Articles wrong - shows future articles based on Posted date
Bloke wrote:
We’d have to scrape through Robert’s brain
I object. May I give you this instead?
Root problem: Using now() for LastMod won’t work with posted dates != now(). Needs a little thinking, indeed…
Offline
#5 2011-01-31 14:35:55
- edmungo
- Member
- Registered: 2006-07-10
- Posts: 12
Re: Recent Articles wrong - shows future articles based on Posted date
The LastMod date will almost always be wrong then, as when an article is modified Rob’s r3172 fix sets LastMod to when() – i.e. the Posted date. Only when “Set timestamp to now” is checked on article save, would LastMod be correct, and wrong in all other cases.
So r3172 is a bad fix IMO. Rob’s log message reads “Synchronize LastMod and LastModID with Posted and AuthorID when an article is initially created.”, which is no good because creation takes place now(), not at posted date. Seems like an easy fix – revert to now() for the LastMod and add a LastModID as per r3172
Setting a LastModID fixes Rick’s initial problem I think, where a’modified by’ name does not appear on new articles – e.g. “Last modified by: · 29 Mar 2009 · 08:44:39” on the write page, but that’s a minor issue compared to dodgy mod dates.
So can (or how do) we get this fixed? Maybe I hack it for now?
Offline
Re: Recent Articles wrong - shows future articles based on Posted date
Please try r3983.
Offline