Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
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
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
Re: Workarounds for Txp 4.4.0 until upgrade?
At least Textpattern 4.5.7 works fine with PHP 5.6.33.
Offline
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
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
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
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
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
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
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