Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2013-08-30 10:46:11
- Gallex
- Member
- Registered: 2006-10-08
- Posts: 1,331
[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
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,331
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
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.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
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,331
Re: [solved] parse error
just changed this function yield() to this function yield2(). it helped
Offline
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.
Offline
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.
Offline
Re: [solved] parse error
An interim Textpattern v4.5.5 release gets my vote too.
Offline
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
phiw13 on Codeberg
Offline
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
Re: [solved] parse error
I have 3 TxP sites on my present server. Today I installed another one and I am getting this error:
Internal error "preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead".
All sites are using TxP 4.5.5 and PHP Version 5.5.7. the other sites seem fine.
UPDATE; the other three are using PHP Version 5.4.17
2nd UpdateL: now seeing these errors
nternal error "preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead"
in /home/bright/webapps/enginececom/textpattern/lib/classTextile.php at line 1860.
adminErrorHandler()
textpattern/lib/classTextile.php:1860 preg_replace()
textpattern/lib/classTextile.php:1204 Textile->footnoteRef()
textpattern/lib/classTextile.php:1155 Textile->graf()
textpattern/lib/classTextile.php:1026 Textile->fBlock()
i
Last edited by bici (2014-02-28 07:24:51)
…. texted postive
Offline
Re: [solved] parse error
I see you are using WebFaction.
I must admit, I default to PHP5.4 for my Textpattern installs on WebFaction as I’m not sure that Textpattern is fully compatible with PHP5.5.
Have you tried changing the webapp to use PHP 5.4 instead?
Offline
Re: [solved] parse error
springworks wrote #279321:
I see you are using WebFaction.
I must admit, I default to PHP5.4 for my Textpattern installs on WebFaction as I’m not sure that Textpattern is fully compatible with PHP5.5.
Have you tried changing the webapp to use PHP 5.4 instead?
well that worked! it was not clear how to fall back to an earlier version, but finally found the tip to do it via the .htaccess file. I guess when i installed the “app” in webfaction the latest is 5.5.7. i’l ouse tyne 5.3 from now on,
…. texted postive
Offline