Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2013-08-30 10:46:11

Gallex
Member
Registered: 2006-10-08
Posts: 1,289

[solved] parse error

today i found this from one of my pages:

Parse error: syntax error, unexpected 'yield' (T_YIELD), expecting '(' in /srv/n1/w/kotkas/aaxumu/html/textpattern/publish/taghandlers.php on line 313

what i need to do?

Offline

#2 2013-08-30 12:02:19

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: [solved] parse error

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).

Last edited by Gocom (2013-08-30 12:03:09)

Offline

#3 2013-08-30 12:37:48

Gallex
Member
Registered: 2006-10-08
Posts: 1,289

Re: [solved] parse error

here are rows from 297-329. what i need to change here:

// -------------------------------------------------------------

	function output_form($atts, $thing = NULL)
	{
		global $yield;

		extract(lAtts(array(
			'form' => '',
		), $atts));

		if (!$form)
		{
			trigger_error(gTxt('form_not_specified'));
		}
		else
		{
			$yield[] = $thing !== NULL ? parse($thing) : NULL;
			$out = parse_form($form);
			array_pop($yield);
			return $out;
		}
	}

// -------------------------------------------------------------

	function yield()
	{
		global $yield;

		$inner = end($yield);

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

Offline

#4 2013-08-30 15:58:23

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

Re: [solved] parse error

This is the second report in as many weeks. If hosts are starting to upgrade servers to PHP 5.5, should we be thinking about an interim Txp 4.5.5 release with a temporary tpt_ style patch?


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

#5 2013-08-30 17:00:07

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: [solved] parse error

Bloke wrote:

This is the second report in as many weeks. If hosts are starting to upgrade servers to PHP 5.5, should we be thinking about an interim Txp 4.5.5 release with a temporary tpt_ style patch?

Even if they didn’t, wouldn’t be bad idea. Its just two lines and ensures that users can update their PHP versions in case they need to. Not saying that Textpattern actually works well on PHP >=5.4. Well, it does work, but not necessarily as intended; Error handlers probably display wrong error types (I changed it to whitelisting in 4.6-dev to ensure every PHP version displays same results) and uses that deprecated MySQL extension.

Last edited by Gocom (2013-08-30 17:01:04)

Offline

#6 2013-08-31 11:03:12

Gallex
Member
Registered: 2006-10-08
Posts: 1,289

Re: [solved] parse error

just changed this function yield() to this function yield2(). it helped

Offline

#7 2013-08-31 15:50:45

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: [solved] parse error

A patch version (v4.5.x) would be welcome, as the time when servers upgrade to PHP 5.5 will eventually arrive, and if I got this issue right, existing installations of 4.5.x will break.
At that time, it may not be possible for site owners to easily upgrade to Txp 4.6 (or whichever version is the most up-to-date Txp release at the time), and so, a patch version would make it easy to fix a broken installation.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#8 2013-09-13 14:30:07

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: [solved] parse error

I’ve been bitten by this issue (on my local server, Debian Testing with PHP 5.5.3-1), on a Txp 4.4.1 installation.
I may be able to jump to 4.5.x series if a patch is provided (but it will be even better if the patch is applicable on top of 4.4.1).
In the meanwhile, I’ll look into downgrading PHP on my local server.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#9 2013-09-13 16:05:40

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,564
Website GitHub Mastodon

Re: [solved] parse error

An interim Textpattern v4.5.5 release gets my vote too.

Offline

#10 2013-09-14 03:47:06

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

Re: [solved] parse error

philwareham wrote:

An interim Textpattern v4.5.5 release gets my vote too.

Agreed.

One of my Japanese hosts has notified us that they’ll upgrade to PHP 5.5 within the next month.


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

Offline

#11 2013-09-14 03:56:55

bici
Member
From: vancouver
Registered: 2004-02-24
Posts: 2,072
Website Mastodon

Re: [solved] parse error

I think it prudent and good public relations to be proactive on this issue.
An interim Textpattern v4.5.5 release gets my vote too.


…. texted postive

Offline

#12 2013-10-07 23:39:02

bigHairyBird
New Member
Registered: 2013-10-07
Posts: 1

Re: [solved] parse error

I installed 4.5.5 and the dreaded ‘ textpattern Parse error: syntax error, unexpected ‘yield’ (T_YIELD)’ issues seems to be a thing of the past. Just having fun FreeBSD 9.2

EDIT: removed software list

It takes a while to get all things working . . .

Last edited by philwareham (2013-10-08 19:37:22)

Offline

Board footer

Powered by FluxBB