Textpattern CMS support forum

You are not logged in. Register | Login | Help

#11 2018-05-15 18:21:10

Hennie
Member
From: Nederland
Registered: 2009-02-06
Posts: 18
Website

Re: Feedback to: Textpattern CMS 4.7.0 Released

Try adding this to your textpattern/config.php file on the penultimate line

date_default_timezone_set('Europe/Amsterdam');...

Does that help?

Well, bingo! After I searched for ‘penultimate’ :-)
Thanks!

Offline

#12 2018-05-15 18:42:26

gaekwad
Member
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 2,255

Re: Feedback to: Textpattern CMS 4.7.0 Released

Hennie wrote #311785:

Well, bingo! After I searched for ‘penultimate’ :-)

Great news! Your English is much better than my Dutch, but I think I mean ‘voorlaatste’.

Offline

#13 2018-05-15 18:45:44

gaekwad
Member
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 2,255

Re: Feedback to: Textpattern CMS 4.7.0 Released

Bloke wrote #311778:

Perhaps we need to pass UTC (or a random timezone) just to shut it up if – and that’s the question, if – we can detect if one hasn’t been set already. Dunno. Will gladly take advice on this.

If the timezone isn’t set, default to Etc/UTC. That’s a standard, not geographical, and can be overridden in prefs easily enough.

Is it related to this timezone issue?

It’s a stretch, but there is a connection. Having Etc/UTC available would solve a few snags like this. See also #403 (among others).

Last edited by gaekwad (2018-05-15 18:46:01)

Offline

#14 2018-05-15 18:58:35

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,315
Website

Re: Feedback to: Textpattern CMS 4.7.0 Released

In reply to colak #311784:

What if instead of this warning… we could have…

I think that error message is thrown by PHP. We don’t have a say in it as far as I know.

gaekwad wrote #311787:

If the timezone isn’t set, default to Etc/UTC.

Providing we can accurately trap this error, perhaps through some judicial try... catch logic (and not have to do it every time so it doesn’t slow stuff down), then yes.

It makes sense to try and default to something like that during setup/upgrade. I’d far rather do it there once – even if it’s the wrong timezone – than every time we call a date function, which is potentially more computationally expensive. But I don’t know if that’s possible. We can’t write to php.ini.

See also #403 (among others).

Jeez, and that issue’s only 5 years old now. We really should have fixed this by now.


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

#15 2018-05-15 19:03:26

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,315
Website

Re: Feedback to: Textpattern CMS 4.7.0 Released

P.S. Drupal solved it like this:

// Make sure PHP has a valid time zone set.
$timezones = \DateTimeZone::listIdentifiers();
$timezone = ini_get('date.timezone');
if (empty($timezone) || !in_array($timezone, $timezones)) {
  ini_set('date.timezone', 'UTC');
}

But doing that every page load might get tiresome so it’d be nice if we could flag this somehow in debugging mode.


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

#16 2018-05-15 19:15:35

gaekwad
Member
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 2,255

Re: Feedback to: Textpattern CMS 4.7.0 Released

Bloke wrote #311790:

But doing that every page load might get tiresome so it’d be nice if we could flag this somehow in debugging mode.

Or perhaps the Diagnostics panel. Having it as part of the install would cover many (most?) instances of this issue. Likewise, now that the upgrade process won’t start if minimum spec isn’t met, is there scope to do a similar check for a valid timezone as part of the upgrade scripts?

Offline

#17 2018-05-15 20:40:26

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,315
Website

Re: Feedback to: Textpattern CMS 4.7.0 Released

gaekwad wrote #311791:

Or perhaps the Diagnostics panel.

That would work.

is there scope to do a similar check for a valid timezone as part of the upgrade scripts?

Yes and no. Yes we could do it, but as it’s not really an error, we probably shouldn’t force the upgrade to stop.

Sure, if we use a default, things might behave a bit weirdly and articles might not appear where you expect, but since PHP will drop back to a default without batting an eyelid, it’s not a big deal. The only reason it’s turned from a PHP warning to a Txp fatal error is because we don’t handle it properly; we assume the timezone is set properly, which is not the right thing to do.

The sensible – if slightly costly – thing to do is take the approach similar to what Drupal did above. Every page load, check if the ini timezone variable is set and if it’s not, force UTC. Repeat.

Also, in debugging mode, flag this so it forces people to either fix it for real or switch to Live to suppress it. What I don’t know is whether setting the timezone pref inside Txp is a good enough substitute for the php.ini timezone key or if it MUST be set there. I’m a bit fuzzy on this area.

Last edited by Bloke (2018-05-15 20:42:21)


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

#18 2018-05-17 01:44:14

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,389

Re: Feedback to: Textpattern CMS 4.7.0 Released

This is a great moment! Many thanks to everyone who has worked on the development of this new version. A huge step forward.

Now I will have to deal with all the improvements. I hope I can handle this. Until now I had little time for it, and much still seems difficult to me to understand. I haven’t always been able to follow the news in the forum. Life in Ecuador isn’t easy. And hopefully someday I can give something back to you.

Also many thanks to @jakob for the updates of the very important plug-ins bot_wtc and glz_custom_fields. What would we do without them?

Thanks and all my admiration for you.

Offline

#19 2018-05-18 07:06:30

Destry
Moderator
From: Haut-Rhin
Registered: 2004-08-04
Posts: 3,826
Website

Re: Feedback to: Textpattern CMS 4.7.0 Released

In 4.7, Articles panel, I selected a few articles by checking the boxes and used the controls to change their status all at once. No problem. When done, the boxes on the articles were still checked. Shouldn’t they automatically uncheck at that point to confirm job well done?

I honestly can’t remember how it’s always been. It’s not a big deal; just seemed odd to me from a feedback standpoint.


Fewer humans and more trees.

Offline

#20 2018-05-18 07:27:29

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 1,473
Website

Re: Feedback to: Textpattern CMS 4.7.0 Released

It gives you an additional (visual) cue which articles you just modified – the (green) message box only tells you the ID. You don’t need to hunt for them (again), useful if they are not next to each other. Also, maybe you want to do some further action on those articles (add / modify a category maybe?) The multi-edit feature only allows one action at the time.

Offline

Board footer

Powered by FluxBB