Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2013-07-09 13:41:18

lazyadmin
Member
From: Germany
Registered: 2009-08-08
Posts: 25
Website

The "yield" tag and PHP 5.5.0 (kind of a fix inside)

Hi,

this is my first error report or whatever you wanna call it – so sorry if my explanations aren’t as awesome as you expect.

On my localhost I played around and upgraded to PHP 5.5.0. Suddenly only this error popped up (both front- and backend):

syntax error, unexpected 'yield' (T_YIELD), expecting '(' in [...]textpattern\publish\taghandlers.php on line 313

“Quite baffling” I thought, but just for a few minutes: In this version of PHP “yield” became a reserved word and can’t be used for our tag anymore.

I’m aware that only a few people use PHP 5.5 now, but a fix would be a cool thing to have in the future (in which even the lamest hosting providers will upgrade).

So, what to do? Renaming the function also means renaming the tag and renaming it in forms etc., am I right? Is there an alternative without breaking compatibility?

Update: Okay, wait. I guess we just need to rename the function and tweak the “processTags” function in textpattern/lib/txplib_publish.php. I should have looked up earlier..

Last edited by lazyadmin (2013-07-09 13:53:48)

Offline

#2 2013-07-09 16:13:57

CeBe
Plugin Author
From: Caen - Fr
Registered: 2010-06-25
Posts: 345
Website

Re: The "yield" tag and PHP 5.5.0 (kind of a fix inside)

lazyadmin a écrit:

Okay, wait. I guess we just need to rename the function and tweak the “processTags” function in textpattern/lib/txplib_publish.php

Yep, exactly as it is for <txp:link />, named tpt_link() to avoid a clash with link().

Offline

#3 2013-07-09 18:12:12

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

Re: The "yield" tag and PHP 5.5.0 (kind of a fix inside)

lazyadmin wrote:

In this version of PHP “yield” became a reserved word

Dammit. Knew not having proper namespacing in tags was gonna bite us eventually. Gocom’s done some great work in the next version of Txp to add a tag registry, so that could avoid such collisions without all the silly renaming hoops we’ve jumped through in the past.

Thanks for the report, would you raise it as an issue on the tracker please?

Last edited by Bloke (2013-07-09 18:14:16)


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

#4 2013-07-10 03:41:35

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,323
Website Mastodon

Re: The "yield" tag and PHP 5.5.0 (kind of a fix inside)

Thanks for the report. I have created an issue to track this defect.

Offline

#5 2013-07-10 08:24:17

lazyadmin
Member
From: Germany
Registered: 2009-08-08
Posts: 25
Website

Re: The "yield" tag and PHP 5.5.0 (kind of a fix inside)

Excellent, Robert! Thanks for fixing it so quickly. Time to switch to development branch now for me ;-)

Offline

#6 2014-09-16 15:18:23

madzzoni
Member
From: Grünberg/Hessen/DE
Registered: 2013-01-22
Posts: 38

Re: The "yield" tag and PHP 5.5.0 (kind of a fix inside)

Hi there.

Where do i find the fix for this PHP 5.5 issue?
- or do i have to edit /the txplib_publish.php direct?

Thx and regards madzzoni


<TXP:n00b />

Offline

#7 2014-09-16 15:41:51

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

Re: The "yield" tag and PHP 5.5.0 (kind of a fix inside)

madzzoni wrote #283792:

Where do i find the fix for this PHP 5.5 issue?

In the official Textpattern 4.5.5 download.


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