Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2018-01-23 19:59:47

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 999
Website

Workarounds for Txp 4.4.0 until upgrade?

Dear Textpatrons,

A client contacted me about an old site that is still running Textpattern 4.4.0 with PHP 5.3.29. Their server will soon disable support for the PHP 5.3 series, and they require that all sites run on 5.6.33 or 7.0.27. But when I run the site on PHP 5.6, the public pages are replaced with this error:

Parse error: syntax error, unexpected ‘yield’ (T_YIELD), expecting ‘(’ in /var/www/html/jo/journaltalk.net/textpattern/publish/taghandlers.php on line 322

And the Textpattern admin panels show numerous errors like this: “Non-static method class::method() should not be called statically…”

The site depends on several plugins that are no longer supported, and they don’t have a budget to upgrade the Textpattern installation at this time. Is there any work-around I can put in place in order to make the site compatible with PHP 5.6+?

Thank you!

Offline

#2 2018-01-23 20:29:12

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 999
Website

Re: Workarounds for Txp 4.4.0 until upgrade?

Update: It looks like the “Non-static method class::method() should not be called statically…” errors should be resolved simply by upgrading Textpattern to version 4.5.x. But I don’t see a “history” file in that version of the repository. Can anyone confirm that Textpattern 4.5 is compatible with PHP 5.6 series?

Offline

#3 2018-01-23 20:32:32

kuopassa
Plugin Author
From: Porvoo, Finland
Registered: 2008-12-03
Posts: 229
Website

Re: Workarounds for Txp 4.4.0 until upgrade?

At least Textpattern 4.5.7 works fine with PHP 5.6.33.

You can find old versions from Github.

Offline

#4 2018-01-23 20:39:10

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 999
Website

Re: Workarounds for Txp 4.4.0 until upgrade?

Thanks, @kuopassa!

I’m a fool. Of course the current history file includes the history of 4.5.x!

Offline

#5 2018-01-23 23:54:00

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 999
Website

Re: Workarounds for Txp 4.4.0 until upgrade?

Okay, I created a working copy of the site on a virtual box with PHP5.6, and upgraded Textpattern to v4.5.0. Textpattern’s admin interface seems to work perfectly now on the test site, but I still see this error when requesting any front-end page:

Parse error: syntax error, unexpected ‘yield’ (T_YIELD), expecting ‘(’ in /var/www/public/textpattern/publish/taghandlers.php on line 313

Offline

#6 2018-01-24 00:42:21

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 999
Website

Re: Workarounds for Txp 4.4.0 until upgrade?

Line 313 of taghandlers.php in version 4.5.0 was the definition of the txp:yield tag:

	function yield()
	{
		global $yield;

		$inner = end($yield);

		return isset($inner) ? $inner : '';
	}

Can anyone suggest any possible reason for the error?

Offline

#7 2018-01-24 01:20:32

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 999
Website

Re: Workarounds for Txp 4.4.0 until upgrade?

The above Parse error also appears on every plugin-generated page under Textpattern’s “Extensions” tab.

Offline

#8 2018-01-24 03:03:12

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,081
Website

Re: Workarounds for Txp 4.4.0 until upgrade?

That is fixed in 4.6 – if I recall correctly (my aging memory has lots of holes), it had something to do with yield being a reserved keyword in PHP or something like that. There is a forum post on the subject which I cannot seem to find right now. Bloke or Oleg might be able to expand (and correct me of course…).

I think patching 4.5 with the equivalent of what is in 4.6. taghandlers should fix it.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#9 2018-01-24 03:46:07

michaelkpate
Moderator
From: Avon Park, FL
Registered: 2004-02-24
Posts: 1,379
Website GitHub Mastodon

Re: Workarounds for Txp 4.4.0 until upgrade?

phiw13 wrote #308843:

That is fixed in 4.6 – if I recall correctly (my aging memory has lots of holes), it had something to do with yield being a reserved keyword in PHP or something like that.

Something like that, indeed.

Textpattern 4.5.x isn’t compatible with PHP 5.5. PHP 5.5 added a new keyword named yield, which collides with our template tags and its function yield(). You can either downgrade to PHP 5.4, remove the function from the source file or use a development version of Textpattern (4.6-dev). – Gocom

Offline

#10 2018-01-24 09:54:09

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

Re: Workarounds for Txp 4.4.0 until upgrade?

It was fixed in 4.5.5. I’d suggest that as minimum but if you can stretch to 4.6.2, then that’s better.


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

Board footer

Powered by FluxBB