Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2017-03-12 17:43:26
- chad
- Member
- Registered: 2006-08-06
- Posts: 12
Fix for `undefined function tpt_yield()`
After upgrading from 4.5.7 to 4.6.2, I got this error when trying to load my site:
Fatal error: Call to undefined function tpt_yield() in /mysite/textpattern/publish/taghandlers.php(4344) : eval()'d code on line 2
I was using tpt_yield
in one of my forms, inside a <txp:php>
block. It seems there’s a new way to call this function now. It took me a little while to figure out, so I’m documenting it here in case anyone else has the problem.
Replace: txp_yield()
With: Txp::get('\Textpattern\Tag\Syntax\Partial')->renderYield()
Last edited by chad (2017-03-12 17:44:16)
Offline
Re: Fix for `undefined function tpt_yield()`
curious. what does the code actually do?
…. texted postive
Offline
#3 2017-03-12 19:43:56
- chad
- Member
- Registered: 2006-08-06
- Posts: 12
Re: Fix for `undefined function tpt_yield()`
It’s the PHP equivalent of the <txp:yield /> tag.
I’m using it like this:
<txp:output_form form="my_form">my-file.jpg</txp:output_form>
my_form:
<txp:php>
$imagefile = 'images/'.Txp::get('\Textpattern\Tag\Syntax\Partial')->renderYield();
if (file_exists($imagefile)) { ... }
</txp:php>
Offline
Re: Fix for `undefined function tpt_yield()`
thanks. gave me an idea and i actually can use this
…. texted postive
Offline
Re: Fix for `undefined function tpt_yield()`
??? tpt_yield()
??? Are you sure you did not mistype something?
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: Fix for `undefined function tpt_yield()`
colak wrote #304650:
???
tpt_yield()
??? Are you sure you did not mistype something?
I think there was a reason for it having a deliberately alternative name. Jukka explained it here.
TXP Builders – finely-crafted code, design and txp
Offline