Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-09-07 12:58:32

Sam
Member
From: New York City
Registered: 2004-06-26
Posts: 127
Website

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 best guess is that it has something to do with the time zones.
  • My server time is: Server TZ: Pacific/Honolulu
  • My local time is: Time Zone: Europe/London (0)
The reason I guess this is the time’s off the posts:
  • 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!

Offline

#2 2009-09-07 13:02:13

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,793
Website GitHub

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

Offline

#3 2009-09-07 13:05:22

Sam
Member
From: New York City
Registered: 2004-06-26
Posts: 127
Website

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.

Offline

#4 2009-09-07 13:25:41

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,793
Website GitHub

Re: Live Articles 404'ing, suspect it is due to Time Zone & Permalink mode

Definitely timezone related, since:

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

Offline

#5 2009-09-07 13:33:22

Sam
Member
From: New York City
Registered: 2004-06-26
Posts: 127
Website

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.

Offline

#6 2009-09-07 13:48:42

Sam
Member
From: New York City
Registered: 2004-06-26
Posts: 127
Website

Re: Live Articles 404'ing, suspect it is due to Time Zone & Permalink mode

Perhaps also worth noting, it doesn’t seem to be happening to the latest posts. The last few posts for example were posted as so:
  • 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.
However, their permalinks are:
  • 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?

Offline

#7 2009-09-07 14:16:21

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,793
Website GitHub

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

Offline

#8 2009-09-07 14:36:18

Sam
Member
From: New York City
Registered: 2004-06-26
Posts: 127
Website

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

Offline

#9 2009-09-08 04:57:17

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,340
Website GitHub Mastodon

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

#10 2009-09-08 09:50:10

Sam
Member
From: New York City
Registered: 2004-06-26
Posts: 127
Website

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?

Offline

#11 2009-09-08 09:55:26

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,340
Website GitHub Mastodon

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

#12 2009-09-08 10:09:40

Sam
Member
From: New York City
Registered: 2004-06-26
Posts: 127
Website

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.

Offline

Board footer

Powered by FluxBB