Textpattern CMS support forum

You are not logged in. Register | Login | Help

#11 2016-10-05 21:06:29

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

Re: Feedback to: Textpattern CMS 4.6.1 released

Crap, I’m not getting blocked at the Languages panel, but my version string isn’t being updated. I swear I checked that. Must be going senile.

From what I can tell in update/_update.php, since there’s no entry for 4.6.1 in the first array (there’s no _to_4.6.1.php file: it’s not necessary) the DB is comparing the current version of your install (4.6.0) with the “latest” version in that array (4.6.0) and shrugging its shoulders, bailing out of the update. Thus it never gets to the part that updates the db version string at the end of the script.

Anyone else seeing this? If so we’ll need to tweak the update script and bundle up a 4.6.2 sometime soon.

Functionally in this case, it’s not exactly a deal breaker when updating from 4.6.0. Nothing bad will happen as there’s no database manipulation to do: all changes in this release are file-based. The only fallout is:

  1. Any custom post-install scripts won’t run.
  2. Your DB version string in the txp_prefs table remains at 4.6.0. (test with select * from txp_prefs where name = 'version';. You can manually alter this with update txp_prefs set val='4.6.1' where name = 'version'; if you wish).
  3. You won’t land on the Languages panel after install.

That last point is interesting because anyone who is getting stuck on the Languages panel is probably upgrading from a version prior to 4.6.0. But that appears to be broken in 4.6.1 due to this line of code in txplib_db.php:

$trace->stop("[Rows: ".intval(@mysqli_num_rows($result))."]");

It seems that, despite asking it to mask errors, PHP dutifully does so, but still triggers an exception which our update script catches and bails out immediately after the first ALTER TABLE command in _to_4.6.0.php. You can prove this by removing the ‘@’ sign in the above line of code, setting your DB version to 4.5.7 and logging in. You get an ‘internal error’ because the result set from an ALTER statement contains no rows: it returns true/false.

Bugger.

One thing you can do to make the upgrade go more smoothly is to switch production status to Live prior to upgrading.

Looks like we have to unpick this mess. And there was me thinking we’d got the upgrade woes licked. Hold fire everyone. Sorry.


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

#12 2016-10-05 21:24:54

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

Re: Feedback to: Textpattern CMS 4.6.1 released

I posted the blog post link to Hacker News and it’s currently front page at #10.

This might generate a bunch of incoming traffic to textpattern.com

So, uhh, sorry if the subsequent traffic kills the server.

Edit: down to #27, will drop off the front page soon, as you were.

Last edited by gaekwad (2016-10-05 21:28:33)

Offline

#13 2016-10-05 21:47:35

jakob
Moderator
From: Germany
Registered: 2005-01-20
Posts: 3,157
Website

Re: Feedback to: Textpattern CMS 4.6.1 released

Bloke wrote #301989:

Crap, I’m not getting blocked at the Languages panel, but my version string isn’t being updated … You get an ‘internal error’ because the result set from an ALTER statement contains no rows: it returns true/false.

Interesting. I had the same problem updating to the current dev version from an earlier 4.6. beta. At some point I did get an internal error that I couldn’t clear. I did manage to get around it at some point, and I think it was through manually editing the version number string (which was still on 4.5.7 despite being a 4.6 dev), manually setting to live, killing cookies, and reloading the public site before logging in again. I thought it was down to my beta-version update, so didn’t report.


TXP Builders – finely-crafted code, design and txp

Online

#14 2016-10-05 22:03:03

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

Re: Feedback to: Textpattern CMS 4.6.1 released

jakob wrote #301991:

I thought it was down to my beta-version update, so didn’t report.

Not your fault, I should have picked it up. The problem was that I made a fatal assumption: that the version reported in Diagnostics and the bottom of the admin screen was the version set in the DB txp_prefs table. That is NOT the case.

The update script was not running at all, but the Diagnostics screen reported 4.6.1. I should have checked the value in the DB too and I’d have noticed the update script was (silently) failing and uncovered the bug.

Note to self: add version check in Diagnostics panel to verify that DB value of version matches file version number.

I’ve patched txplib_db.php locally. That one’s easy to fix. What’s tougher to fix is how to service point releases that don’t have an entry in the $dbupdates array. Thought it might be a simple case of setting the $dbversion to $thisversion to match what’s set in the index.php file if we’ve dropped off the end of the array, but upgrading from earlier versions resets that again when it runs that specific update script. Makes for messy code. There has to be a better way…


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 2016-10-05 22:37:00

mrdale
Moderator
From: Walla Walla
Registered: 2004-11-19
Posts: 2,201
Website

Re: Feedback to: Textpattern CMS 4.6.1 released

Here’s how I managed to get past the language roadblock.

  • I had duplicated my root directory so I had a
    • “public.old” (existing 4.6dev) and
    • “public” (new 4.7dev)
  • version in the prefs was 4.5.7
  • renamed the directories so that the old dir was used.
  • updated my language selection
  • renamed the public folders

Worked.

Offline

#16 2016-10-06 00:30:57

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

Re: Feedback to: Textpattern CMS 4.6.1 released

Fwiw I just had the same issue (stuck at Languages panel) while installing a brand new TXP4.7-dev site on localhost.

  • Fetched the code (git checkout …)
  • create DB etc.
  • go to /textpattern/setup, go through the little dance – OK.
  • login, this brings me to the Languages panel (surprised by this actually, it is a brand new install).

No way to navigate any further. I can login / logout etc, but always land on the Languages panel. Attempts to install addition languages also fails.

I see the following in my apache error log:

[Thu Oct 06 09:15:12.684442 2016] [:error] [pid 546] [client 127.0.0.1:53978] PHP Warning:  include(/Users/username/Sites/_txp47/textpattern/config.php): failed to open stream: No such file or directory in /Users/username/Sites/_txp47/index.php on line 81
[Thu Oct 06 09:15:12.701765 2016] [:error] [pid 546] [client 127.0.0.1:53978] PHP Warning:  include(): Failed opening '/Users/username/Sites/_txp47/textpattern/config.php' for inclusion (include_path='.:') in /Users/username/Sites/_txp47/index.php on line 81

Looking at the txp-prefs table through Sequel Pro, I see that the version is 4.6.0.

PS – installing, on the same localhost, a brand new TXP-4.6.1 works perfectly fine, as far as I can see.

Last edited by phiw13 (2016-10-06 00:31:12)

Offline

#17 2016-10-06 07:08:01

NicolasGraph
Plugin Author
From: France
Registered: 2008-07-24
Posts: 860
Website

Re: Feedback to: Textpattern CMS 4.6.1 released

jakob wrote #301991:

I thought it was down to my beta-version update, so didn’t report.

Same; I thought it was my fault because I had the problem on only one install; but as far as I understand it is because of a different production status…

Bloke wrote #301989:

One thing you can do to make the upgrade go more smoothly is to switch production status to Live prior to upgrading.


Nicolas
Follow me on Twitter and GitHub!
Multiple edits are usually to correct my frenglish…

Offline

#18 2016-10-06 09:02:44

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

Re: Feedback to: Textpattern CMS 4.6.1 released

phiw13 wrote #301994:

Fwiw I just had the same issue (stuck at Languages panel) while installing a brand new TXP4.7-dev site on localhost.

Patching my TXP-4.7.0-dev textpattern/lib/txplib_db.php with Bloke’s patch here allowed me to escape out of being stuck at the Languages panel. Dunno yet if everything works fine, I’ve had little time to test, busy with clean around my house after typhoon #18.

Last edited by phiw13 (2016-10-06 09:13:06)

Offline

#19 2016-10-06 09:07:20

philwareham
Core designer
From: Farnham, Surrey, UK
Registered: 2009-06-11
Posts: 3,092
Website

Re: Feedback to: Textpattern CMS 4.6.1 released

phiw13 wrote #301998:

Patching my TXP-4.7.0-dev textpattern/lib/txplib_db.php

I’ve copied that patch code into the 4.7.0-dev branch now, as a quick fix

Offline

#20 2016-10-06 09:13:18

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

Re: Feedback to: Textpattern CMS 4.6.1 released

philwareham wrote #301999:

I’ve copied that patch code into the 4.7.0-dev branch now, as a quick fix

Cool, thanks.

Offline

Board footer

Powered by FluxBB