Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Live Articles 404'ing, suspect it is due to Time Zone & Permalink mode
I’ve been having this problem intermitently since I started using the /year/month/day/title
Permanent link mode at welovetxp.com
These articles are set to Live but display the 404 page:
http://welovetxp.com/2009/04/19/ovsem (ID#852)
http://welovetxp.com/2009/04/18/long-beach-lifeguard-association (ID#850)
However, the article inbetween (ID#851) loads just fine:
http://welovetxp.com/2009/04/19/dasbahnblog
- My server time is: Server TZ: Pacific/Honolulu
- My local time is: Time Zone: Europe/London (0)
- ID#852 was posted at 20 Apr 2009 09:00:00
- ID#851 was posted at 19 Apr 2009 21:00:00
- ID#850 was posted at 19 Apr 2009 09:00:00
For some strange reason a lot (I’ve not checked exactly but there are some 900+ articles at welovetxp) are not working.
I’d be more than happy to give people access to welovetxp’s Textpattern interface and/or database if they need to dig around some.
I’d love some help figuring out this problem. Thanks!
Sam Brown
sambrown.me | welovetxp.com
Offline
Re: Live Articles 404'ing, suspect it is due to Time Zone & Permalink mode
Mental! Seems like a time issue to me too on the surface, though quite why is a mystery at present. Are you using 4.2.0 yet?
Last edited by Bloke (2009-09-07 13:03:00)
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
Online
Re: Live Articles 404'ing, suspect it is due to Time Zone & Permalink mode
Hi Stef, yes, I’m using 4.2, this was happening in previous versions also though.
Sam Brown
sambrown.me | welovetxp.com
Offline
Re: Live Articles 404'ing, suspect it is due to Time Zone & Permalink mode
Definitely timezone related, since:
- http://welovetxp.com/2009/04/20/ovsem (actual posted date) is fine
- http://welovetxp.com/2009/04/19/ovsem (permlink) is not
It appears TXP is subtracting the timezone before generating the permlink since Honolulu is 11 hours behind GMT. Article posted on 20th April at 9:00am (GMT) – 11 hours = 10pm on the 19th April = d’oh.
Stabbing in the dark, but out of curiosity does editing/saving article #852 again make any difference? I can’t remember if 4.2.0 recalculates the datestamp or not on save — would have to check the code (or consult with wet!)
EDIT: and what version of PHP are you using?
Last edited by Bloke (2009-09-07 13:26:45)
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
Online
Re: Live Articles 404'ing, suspect it is due to Time Zone & Permalink mode
Interesting, I hadn’t thought to change the date in the URL to check.
I’m running on PHP version: 5.2.10, editing and saving the article didn’t help unfortunately.
Sam Brown
sambrown.me | welovetxp.com
Offline
Re: Live Articles 404'ing, suspect it is due to Time Zone & Permalink mode
- ID#979 07 Sep 2009 07:00:00
- ID#978 06 Sep 2009 19:00:00
- ID#977 06 Sep 2009 07:00:00
- ID#976 05 Sep 2009 19:00:00
- etc.
- http://welovetxp.com/2009/09/06/corking-design
- http://welovetxp.com/2009/09/06/daniel-marino
- http://welovetxp.com/2009/09/05/rotie-cellars
- http://welovetxp.com/2009/09/05/kontos-cellars
Note: Posted 07, 06, 06, 05 but permalinks are 06, 06, 05, 05 – yet they still work?
Sam Brown
sambrown.me | welovetxp.com
Offline
Re: Live Articles 404'ing, suspect it is due to Time Zone & Permalink mode
Uggg??!!
stef ejects brain and puts it in the fridge for safekeeping
I thought for a moment there it might have been DST-related, but all articles you’ve posted so far were published (just!) when BST was in effect. And Honolulu doesn’t recognise DST shifts — they have the right idea imho :-D
The code for the permlink tag states:
case 'year_month_day_title':
list($y,$m,$d) = explode("-",date("Y-m-d",$posted));
$out = hu."$y/$m/$d/$url_title";
which in layman’s terms is the Posted date of the entry in the database and should therefore not have any offset applied to it: what it spits out is what was saved. In theory.
To really throw a spanner in the works, let’s seek out the articles 852, 851, 850 (and some of the ones you just posted) directly in MySQL (or rss_admin_db_manager) and check out the Posted
dates stored in the database. Do they correspond with the permlink, or the date you see on the Write tab? (or neither!)
I’m all a-flummoxed. Do you have any plugins enabled that might be arsing around with the URL (e.g. gbp_permanent_links, though I doubt that has anything to do with it)? Anyone else have any nuggets of ideas on this one?
Last edited by Bloke (2009-09-07 14:18:26)
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
Online
Re: Live Articles 404'ing, suspect it is due to Time Zone & Permalink mode
I have a bunch of plugins installed, but nothing that I think would adversely affect time zones or permalinks.
ajw_comment_alt, csb_feed_image, gho_comment_tools, mdn_count, rss_admin_show_adv_opts, rss_suparchive, sab_substr, tru_tags, zem_contact_lang, zem_contact_reborn, zem_nth
Latest Articles Posted
times are oddly:
- 2009-09-06 23:00:00
- 2009-09-06 11:00:00
- 2009-09-05 23:00:00
- 2009-09-05 11:00:00
Even though they were set to go live at 19, 07, 19, 07 ???
The 852, 851 & 850 articlesPosted
are:
- 2009-04-20 01:00:00
- 2009-04-19 13:00:00
- 2009-04-19 01:00:00
These were supposed to go live: 09, 21, 09 hours. Where is this time difference coming from?
Confusion much? Happy to give you access to the DB if that’s easier to digest this.
Sam Brown
sambrown.me | welovetxp.com
Offline
Re: Live Articles 404'ing, suspect it is due to Time Zone & Permalink mode
After checking with a vanilla 4.0.8 and 4.2.0 installation, may I throw in a few additional things to consider:
- Both versions of Textpattern (and maybe any older ones, too) are using the GMT timestamp to build a year/month/day permlink, as Stef already posted. This is also the one you read directly from the database.
- This leads to a skew for articles which “cross” midnight when you consider the difference between the local time and GMT.
- This GMT-based URLs are exposed both in the admin-side at the article’s tab “View” link, and on the public side as a result of
<txp:permlink />
.
So, the basic question is: Sam, where have you found the URLs which cause the 404?
Offline
Re: Live Articles 404'ing, suspect it is due to Time Zone & Permalink mode
Robert, I don’t know? :/
Finding them with Search or navigating half a dozen pages back shows the right permlink and it works fine.
These links I’ve had bookmarked from past experiences of them not working (404). Perhaps one of the later versions fixed something, or perhaps I’m just going crazy.
I’m beginning to think there really isn’t an issue here, I am still curious as to why the permlinks use the server date in the permanent link mode as opposed to actual (local time) which I would prefer?
Sam Brown
sambrown.me | welovetxp.com
Offline
Re: Live Articles 404'ing, suspect it is due to Time Zone & Permalink mode
Sam wrote:
I am still curious as to why the permlinks use the server date in the permanent link mode as opposed to actual (local time) which I would prefer?
I suppose this is because local time is volatile, think DST. This design decision is probably very old.
Offline
Re: Live Articles 404'ing, suspect it is due to Time Zone & Permalink mode
That’s true, I guess my biggest issue is really that I’m based in the UK and my server is half way around the world! :P
I’m pretty sure this topic can be laid to rest now. I appreciate your thoughts Robert and Stef, and apologise for not completely understanding my own problem.
Sam Brown
sambrown.me | welovetxp.com
Offline