Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#16 2012-08-31 20:56:18

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Upgrading TextPattern from pre-4.1 versions to TXP 4.5

I can reproduce the error, starting with a fresh install of TXP 4.0.8 (setup completed), then install TXP 4.5. This probably affects all upgrades from pre-4.1 versions to TXP 4.5.

/textpattern/index.php

line 86: set_error_handler('adminErrorHandler', error_reporting());
line 94: $prefs = get_prefs();

/textpattern/lib/txplib_db.php

line 506: $r = safe_rows_start('name, val', 'txp_prefs', 'prefs_id=1 AND user_name=\'\'');

That probably fails because the user_name column was added in TXP 4.2 and the database update to 4.2 hasn’t happened yet at this point (if you’re upgrading from pre-4.2). This triggers adminErrorHandler:

/textpattern/lib/txplib_misc.php

line 571: if ($production_status != 'live' && in_array($errno, array(E_ERROR, E_USER_ERROR))) {
line 572:    die($c['in'].gTxt('get_off_my_lawn', array('{event}' => $event, '{step}' => $step)).$c['out']);
line 573: }

Resulting in the “get of my lawn” error. Interesting is that this triggers only when $production_status != ‘live’… but $production_status isn’t defined on the admin side yet at this point. That happens only after the prefs are extracted (see above), and that precisely what TXP tried to do when this happens.

WORKAROUND
Edit /textpattern/config.php and add this just above the ?> line:

$production_status = 'live';

Then log in on the admin side. It’ll perform the database update. Afterwards, remove that line again from config.php.

Bloke, wet, there’s probably a cleaner solution. Feel free to jump in.

Offline

#17 2012-08-31 21:11:44

andrewowens
New Member
From: Chicago, IL
Registered: 2012-08-30
Posts: 9

Re: Upgrading TextPattern from pre-4.1 versions to TXP 4.5

You. Are. Awesome. Thank you many times over!

That worked perfectly. No errors on the public-facing side. No errors on admin login. No logging in with every page change in the admin side.

Is there anything I can do to repay you?

Offline

#18 2012-08-31 21:41:43

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Upgrading TextPattern from pre-4.1 versions to TXP 4.5

You already did by responding like that :)

Offline

#19 2012-08-31 22:10:24

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,513
Website GitHub

Re: Upgrading TextPattern from pre-4.1 versions to TXP 4.5

ruud wrote:

I can reproduce the error

Eegads. Today’s super-sleuthing brain plaudits go to you, good sir. A fine diagnosis.

And you’re right, we should either document this in the upgrade notes or (better) find some way round it. Quite how I don’t know yet.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#20 2012-09-01 02:38:48

echols85
New Member
Registered: 2012-08-31
Posts: 4

Re: Upgrading TextPattern from pre-4.1 versions to TXP 4.5

Ruud, thanks so much! That worked like a charm.

Offline

#21 2012-09-01 06:29:26

wet
Developer Emeritus
From: Vöcklabruck, Austria
Registered: 2005-06-06
Posts: 3,426
Website GitHub Mastodon

Re: Upgrading TextPattern from pre-4.1 versions to TXP 4.5

Issue 258 tracks this bug.

I think we can either use !defined('TXP_UPDATE'), isset($production_status) or $dbversion === $thisversion as an additional condition inside adminErrorHandler() to catch this and similar issues.

Offline

#22 2012-09-02 08:51:47

wet
Developer Emeritus
From: Vöcklabruck, Austria
Registered: 2005-06-06
Posts: 3,426
Website GitHub Mastodon

Re: Upgrading TextPattern from pre-4.1 versions to TXP 4.5

Fixed in r4091. Please test.

Offline

#23 2013-01-23 21:12:05

zeeforel
Member
From: Nieuwerkerk a/d IJssel, NL
Registered: 2004-10-16
Posts: 92
Website

Re: Upgrading TextPattern from pre-4.1 versions to TXP 4.5

Will this – direct – upgrade to the most recent version (4.5.4) also work when coming from 4.0.4 or 4.0.6? Thanks!

Offline

#24 2013-01-24 06:07:20

wet
Developer Emeritus
From: Vöcklabruck, Austria
Registered: 2005-06-06
Posts: 3,426
Website GitHub Mastodon

Re: Upgrading TextPattern from pre-4.1 versions to TXP 4.5

It will. Plugins are a separate issue, though.

Offline

#25 2013-01-24 18:01:05

zeeforel
Member
From: Nieuwerkerk a/d IJssel, NL
Registered: 2004-10-16
Posts: 92
Website

Re: Upgrading TextPattern from pre-4.1 versions to TXP 4.5

@Wet Thanks! Luckily the number of used plugins ise limited…

Offline

Board footer

Powered by FluxBB