LISE Smarty tag in an UDT

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
webform
Power Poster
Power Poster
Posts: 463
Joined: Sat Nov 25, 2006 3:39 pm
Location: Copenhagen, Denmark

LISE Smarty tag in an UDT

Post by webform »

I have an UDT which gets data from one LISE Instance while presave to another LISE Instance, but it's not working (Server Error 500):

Code: Select all

$item = $params['item_object'];

$id = $item->project;
$smarty_data = "{LISEProjects action='detail' item='".$id."' template_detail='foo'}";

//Save To LISE Instance
$item->project_name = $smarty->display('eval:'.$smarty_data);
The offending line seems to be the LISE tag. But if i do a plain UDT this works:

Code: Select all

$id = isset($params['id']) ? $params['id'] : '';
$smarty_data = "{LISEProjects action='detail' item='".$id."' template_detail='foo'}";
$smarty->display('eval:'.$smarty_data);
Maybe an UDT with a LISE instance presaving to another LISE instance is not possible?
User avatar
Jo Morg
Dev Team Member
Dev Team Member
Posts: 1928
Joined: Mon Jan 29, 2007 4:47 pm

Re: LISE Smarty tag in an UDT

Post by Jo Morg »

webform wrote: Fri Apr 26, 2024 1:42 pm I have an UDT which gets data from one LISE Instance while presave to another LISE Instance, but it's not working (Server Error 500)
[...]
Maybe an UDT with a LISE instance presaving to another LISE instance is not possible?
First of all check your PHP error log, a Server Error 500 is a PHP issue and determining which and where is the 1s step.
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
webform
Power Poster
Power Poster
Posts: 463
Joined: Sat Nov 25, 2006 3:39 pm
Location: Copenhagen, Denmark

Re: LISE Smarty tag in an UDT

Post by webform »

Doh! I totally forgot to check the error log. Sadly it didn't contains much info, so it's no help at all:

Code: Select all

[26/Apr/2024:15:36:59 +0200] "POST /admin/moduleinterface.php" 500
User avatar
Jo Morg
Dev Team Member
Dev Team Member
Posts: 1928
Joined: Mon Jan 29, 2007 4:47 pm

Re: LISE Smarty tag in an UDT

Post by Jo Morg »

I suspect that's the apache access log, not the php error log
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
webform
Power Poster
Power Poster
Posts: 463
Joined: Sat Nov 25, 2006 3:39 pm
Location: Copenhagen, Denmark

Re: LISE Smarty tag in an UDT

Post by webform »

Finally succeed in finding the error in the php error log:

Code: Select all

PHP Notice: Trying to access array offset on value of type null in /lib/smarty/sysplugins/smarty_resource_recompiled.php(52) : eval()'d code on line 18\n
My UDT set as a LISE PreItem Save:

Code: Select all

$item = $params['item_object'];

$id = $item->project; //Value (Item ID from another LISE Instance) is from a Custom Field From Smarty
$smarty_data = "{LISEProjects action='detail' item='".$id."' template_detail='foo'}";

//Save To LISE Instance
$item->project_name = $smarty->display('eval:'.$smarty_data);
Post Reply

Return to “Modules/Add-Ons”